summaryrefslogtreecommitdiffstats
path: root/gitlint
AgeCommit message (Collapse)Author
2016-12-01Initial unit tests and docs for user defined rulesJoris Roovers
Initial set of unit tests and documentation for the user defined rules. More will follow. Additionally: - Added '__eq__' operator for options. Options are equal if their name, value and description match.
2016-08-04Initial support for user-defined rulesJoris Roovers
This is the initial commit adding support for user-defined rules. It's a rather large commit, but I decided to keep a few things out to still try to keep the size manageable. In particular, there will be follow-up commits adding more tests, documentation and validation checks as well as general cleanup. What is present in the current commit: - Support for the 'extra-path' parameter that specifies where to search for user-defined rules - A new user_rules.py module that implements the business logic for finding user-defined rule classes - Example user-defined rules in examples/my_commit_rules.py and examples/my_line_rules.py - A new DirectoryOption class for specifying directory paths as rule options - ./run_tests.sh now print py.test warnings
2016-06-29Refactoring: Rule class hierarchyJoris Roovers
- Removed a lot of the multi-inheritance in the Rule class hierarchy. This will make things simple for other developers. Especially useful in the context of the user defined rules that we have on the roadmap. - MultilineRule is now called CommitRule, more accurately representing its purpose - LineRules now require a target attribute that indicates where to which lines it should be applied. - Commits now have a reference to the gitcontext. Unnecessary gitcontext parameters have been cleaned up. - Additional CLI and git unit tests, increasing coverage - Minor improvements to output formatting in ./run_tests.sh
2016-06-18Bump version to 0.8.0devJoris Roovers
Bumping version back to 0.8.0dev
2016-06-180.7.1 releasev0.7.1Joris Roovers
- Behavior change: gitlint no longer prints the file path by default when using a .gitlint file. The path will still be printed when using the new --debug flag. - Gitlint now prints a correct violation message for the title-match-regex rule. - Gitlint is now better at parsing commit messages cross-platform by taking platform specific line endings into account - Minor documentation improvements Full Release details in CHANGELOG.md.
2016-06-18Improved cross-platform line-end recognitionJoris Roovers
Gitlint now splits commit message lines using platform independent line endings. Also documented how to run a single specific test method using ./run_tests.sh
2016-06-16fix inverted violation message (#13)slipcon
the violation message when a title did not match the expected regex was inverted, e.g. it said that the title "does match" when it should have been "does not match"
2016-06-16Debug mode improvementsJoris Roovers
- Added "debug" as an option that can also be set from config files. - More unit and integration tests for debug - Updated documentation to include a section on general gitlint options.
2016-06-15Add --debug option (#12)slipcon
add --debug option and suppress the "Using config from ..." command line log when --debug is not set. This should make gitlint silent when the comment passed to it is well-formed, but nicely verbose by default on any errors.
2016-04-20Bumping version to 0.8.0devJoris Roovers
gitlint-ignore: all
2016-04-200.7.0 releasev0.7.0Joris Roovers
This release contains mostly bugfix and internal code improvements. Special thanks to William Turell and Joe Grund for bug reports and pull requests. Full Release details in CHANGELOG.md.
2016-04-19Editing commit messages in commit-msg hookJoris Roovers
The commit-msg hook now allows users to edit their commit message in case violations are found. It will now also print the commit message to the stdout when the commit is aborted. This closes #9. We also no longer need to source ~/.bash_profile to get gitlint working with SourceTree. This should make the workaround less platform specific. Added more integration tests to test the various scenarios. Also: minor documentation changes in a few areas
2016-04-16Pylint complianceJoris Roovers
Gitlint now passes pylint validation. Currently only supported for python 2.7. We've added a .pylintrc to customize pylint's behavior for gitlint.
2016-04-16Full python 2.6 supportedJoris Roovers
We now fully support python 2.6. We had to include the unittest2 dependency, update pytest to 2.9.2 and update a bunch of format strings, but this was relatively straightforward :) Also enabled python 2.6 unit tests in TravisCI.
2016-04-16./run_tests.sh and Vagrantfile improvementsJoris Roovers
./run_test.sh --all: run all tests (unit, integration, pep8, git) ./run_test.sh --all-env: run all tests against all python environments defined in Vagrantfile
2016-04-16Fix python 3 unit test failuresJoris Roovers
We had some unit test failures related to setting verbosity in gitlint config. This commit fixes this and puts better parsing and error handling in place for general options. Additionally, we disabled integration test runs in travis because they intermittently fail. Need to investigate why this is, but for now just running unit tests is good enough.
2016-04-15Ignore merge commits by defaultJoris Roovers
Gitlint will now ignore merge commits. The rationale is that the original commit should already be linted and that many merge commits that don't pass gitlint checks by default (e.g. exceeding title length or empty body is very common). This behavior can be overwritten by setting the general option 'ignore-merge-commit=false'.
2016-04-15Improved general option parsing and error handlingJoris Roovers
Gitlint will now show a better error if you try to set a non-existing general option or if you set an incorrect value. Additionally, we've added a ignore-merge-commits general option that will be used to implement merge commit ignore behavior.
2016-04-15Python 2.6 support (#10)Joe Grund
We have a project that uses Python 2.6 and would like to use this tool to verify our commit messages. This PR imports OrderedDict from the ordereddict package if the built-in from collections is not present. Signed-off-by: Joe Grund <grundjoseph@gmail.com>
2016-04-15Improved merge commit detectionJoris Roovers
- Parse parent hashes from git commit if available - Additional/improved unit and integration tests for merge commits
2016-04-15Various minor test and doc improvementsJoris Roovers
- ./run_tests.sh --git now runs gitlint against itself - Updated CHANGELOG.md to reflect 0.7.0dev changes - Use of os.path.realpath to support unit and integration tests on OS X On OS X, Click will resolve '/tmp' to '/private/tmp' (as /tmp is a symlink). The tests were updated to reflect this. - Attempt to run tests on both linux and OS X on TravisCI - Multiple minor updates to documentation
2016-04-14Experimental support for commit-msg hook in SourceTree on OS XJoris Roovers
This closes #7 on OS X. Marking as experimental as it's kinda hard to test outside of developer's own environment (which is also why we don't have tests for this). Currently no plans to support this on other platforms than OS X.
2016-04-09Integration tests for gitlint configJoris Roovers
Also: - Added a couple more unit tests for gitlint commit message parsing - "./run_tests.sh -s" now also returns test count
2016-04-09Refactoring: rules working on a git commitJoris Roovers
In the last commit, we still had the commit_msg property of the GitContext class refer to the commit_msg of the last commit in order to minimize the amount of change in a single commit. This commit continues the refactoring of rules and tests to work on a commit message instead of on the commit_msg property of a gitcontext object.
2016-03-02Adding GitCommit class representing a git commitJoris Roovers
Up until now, gitlint only had to notion of a git commit message. This commit adds the GitCommit class which stores both the commit message, and meta-info related to the commit (author, date, commit id, etc). This will allow us to write gitlint rules based on meta-info (e.g. restrictions on the author email address format). For now, the commit_msg property of the GitContext class just refers to the commit_msg of the last commit. This was done as a temporary measure to reduce the amount of code change in a single commit. Also made some minor documentation sites updates (not published yet).
2016-02-29Removing unnecessary -e argument to read in commit-msg hookJoris Roovers
This fixes #8. Also: - integration test for the commit-msg hook. - ./run_test.sh now show stdout on the console for unit tests
2015-11-22Bumped version to 0.7.0devJoris Roovers
Also fixed issue in README.
2015-11-220.6.1 releasev0.6.1Joris Roovers
- Fix: install-hook and generate-config commands not working when gitlint is installed from pypi.
2015-11-220.6.0 releasev0.6.0Joris Roovers
- Bumped version number to 0.6.0 - Removed unsupported python versions from setup.py - setup.cfg file to support universal python 2 and 3 wheels Full Release details in CHANGELOG.md. Fix: removed unsupported python versions from setup.py
2015-11-18Changed error when target dir is not a git repoJoris Roovers
Previously, the error message always contained "The current directory" which might have been incorrect based on the --target option. This commit adds a better error message containing the absolute path of the target repository. Also fixes a PEP8 formatting issue that caused the travis check to fail.
2015-11-17Install-hook and uninstall-hook commands now respect --targetJoris Roovers
Previously, the install-hook and uninstall-hook commands did not respect the --target option, always installing/unininstalling the git hook in the current directory.
2015-11-17Refactor: using proper subcommands instead of optionsJoris Roovers
gitlint's subcommmands (like generate-config, install-hook, uninstall-hook) now use proper Click subcommands. This makes the code cleaner and allows us to more easily execute code before each subcommand (such as parsing config).
2015-11-12Fix: use absolute path in CLITests.test_generate_configJoris Roovers
Previously, the expected path of the test was hardcoded to /vagrant/testfile which caused failures in travis.
2015-11-12Support for generating sample config filesJoris Roovers
Gitlint now has a --generate-config option that will generate a sample config file. Additionally: - help output improvements - gitlint now returns error code 253 (git error) when git commit message hook install/uninstall fails - Updated CHANGELOG and docs
2015-11-12The --config option now only takes a file pathJoris Roovers
Previously, it also accepted directories as valid input.
2015-11-11Support for --target parameter, indicating the target git repoJoris Roovers
This allows users to lint repos other than the current directory. Also added silver-searcher to the Vagrantfile for developer convenience.
2015-11-11Color output in commit-msg hookJoris Roovers
This makes gitlint results clearer to the user.
2015-11-05Python 3 supportJoris Roovers
Python 3 is now supported. Made some changes to: imports, exception handling, unicode strings. The unit tests will now also be ran against python 3.4 and python 3.5 in travis. Additionally: small bugfix in run_tests.sh related to py.test invocation.
2015-11-05Exit codes now range from 0 to 255Joris Roovers
This is in line with the supported range of bash exit codes: http://tldp.org/LDP/abs/html/exitcodes.html
2015-11-05Better error handling for git errorsJoris Roovers
Better error handling for: - Executing gitlint in a directory that is not a git repository - Executing gitlint when git is not installed
2015-10-04Bumped version to 0.6.0devJoris Roovers
2015-10-04Bumped version to 0.5.0v0.5.0Joris Roovers
Also updated the Changelog.
2015-10-04gitlint-ignore commit msg config can now ignore specific rulesJoris Roovers
Before, gitlint would only parse 'gitlint-ignore: all', now it also supports 'gitlint-ignore: T1, body-hard-tab' and similar rules.
2015-10-02Unit tests for getting info from the local git repoJoris Roovers
The code that queries the local git repo for the last commit message and changed files is now also properly unit tested.
2015-10-02Initial work on supporting python 2.6 and 3.xJoris Roovers
Added some install commands to the Vagrantfile so we can more easily work on python 3 and python 2.6 support. However, both are currently blocked. - Python 3 support: currently blocked on Click not supporting python 3 without significant workarounds: http://click.pocoo.org/5/python3/ - Python 2.6 support: Too many errors around unittest2 incompatibility
2015-10-02Unit tests for --uninstall-hookJoris Roovers
Also improved --install-hook unit tests
2015-10-02Disable gitlint on a per commit basisJoris Roovers
- Users can now add 'gitlint-ignore: all' to their git commit messages to disable gitlint for a specific commit message. Also: - Some additional comments and method renaming
2015-09-25ignore-merge-commit option for body-is-missing ruleJoris Roovers
This new option allows users to choose whether the body-is-missing rule should be ignored for merge commits. This commit also adds the BoolOption class which was required to add this new boolean option.
2015-09-24Ignore B6 when merge commitToby Oxborrow
B6 (body-is-missing) should be ignored when the commit is a merge commit. Merge commits can be generated by automated systems like Gerrit and those systems copy the title from the source commit but may not copy the body. commit-message-6 gives an example.
2015-09-23Experimental: git hook uninstallJoris Roovers
Still missing unit tests, documentation. Needs more overall testing.