Skip to content

Conversation

@thekaveman
Copy link
Member

@thekaveman thekaveman commented Oct 21, 2024

  • Refactors the conventional_pre_commit.format module to use classes instead of the top-level functions
  • All existing behavior is now available on instances of either the Commit or ConventionalCommit class
  • Refactored all internal code to use these classes instead
  • Top-level conventional_pre_commit.format.is_conventional() still exists with the same signature

Finally, this PR introduces the long requested feature to skip merge commits, e.g. Merge branch 'dev' into 'main'. The --strict flag maintains existing behavior of disallowing merge commits.

ht @zlodes #103

Updates the documentation to close #104

@github-actions
Copy link

github-actions bot commented Oct 21, 2024

Coverage report

Click to see where and how coverage changed

FileStatementsMissingCoverageCoverage
(new stmts)
Lines missing
  conventional_pre_commit
  format.py
  hook.py
  output.py 77-78
Project Total  

This report was generated by python-coverage-comment-action

@thekaveman thekaveman changed the title Refactor: format Refactor: classes for format checking Oct 21, 2024
@thekaveman thekaveman force-pushed the refactor/format branch 3 times, most recently from 7278451 to 4f66239 Compare October 25, 2024 22:25
@thekaveman thekaveman marked this pull request as ready for review November 22, 2024 21:23
@thekaveman thekaveman self-assigned this Nov 22, 2024
Copy link
Member

@lalver1 lalver1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me @thekaveman. I went over the refactor to use classes and was able to follow the changes. Then I ran the script to test a merge commit with and without the --strict flag and saw the new behavior.

@thekaveman thekaveman merged commit 5f9c312 into main Dec 20, 2024
5 checks passed
@thekaveman thekaveman deleted the refactor/format branch December 20, 2024 21:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Promote usage of default_install_hook_types

5 participants