Age | Commit message (Collapse) | Author |
|
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.
|
|
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
|
|
- 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
|
|
Bumping version back to 0.8.0dev
|
|
- 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.
|
|
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
|
|
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"
|
|
- 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.
|
|
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.
|
|
gitlint-ignore: all
|
|
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.
|
|
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
|
|
Gitlint now passes pylint validation. Currently only supported for
python 2.7.
We've added a .pylintrc to customize pylint's behavior for gitlint.
|
|
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.
|
|
./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
|
|
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.
|
|
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'.
|
|
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.
|
|
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>
|
|
- Parse parent hashes from git commit if available
- Additional/improved unit and integration tests for merge commits
|
|
- ./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
|
|
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.
|
|
Also:
- Added a couple more unit tests for gitlint commit message parsing
- "./run_tests.sh -s" now also returns test count
|
|
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.
|
|
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).
|
|
This fixes #8.
Also:
- integration test for the commit-msg hook.
- ./run_test.sh now show stdout on the console for unit tests
|
|
Also fixed issue in README.
|
|
- Fix: install-hook and generate-config commands not working when gitlint
is installed from pypi.
|
|
- 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
|
|
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.
|
|
Previously, the install-hook and uninstall-hook commands did not respect
the --target option, always installing/unininstalling the git hook in
the current directory.
|
|
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).
|
|
Previously, the expected path of the test was hardcoded to
/vagrant/testfile which caused failures in travis.
|
|
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
|
|
Previously, it also accepted directories as valid input.
|
|
This allows users to lint repos other than the current directory.
Also added silver-searcher to the Vagrantfile for developer convenience.
|
|
This makes gitlint results clearer to the user.
|
|
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.
|
|
This is in line with the supported range of bash exit codes:
http://tldp.org/LDP/abs/html/exitcodes.html
|
|
Better error handling for:
- Executing gitlint in a directory that is not a git repository
- Executing gitlint when git is not installed
|
|
|
|
Also updated the Changelog.
|
|
Before, gitlint would only parse 'gitlint-ignore: all', now it also
supports 'gitlint-ignore: T1, body-hard-tab' and similar rules.
|
|
The code that queries the local git repo for the last commit message and
changed files is now also properly unit tested.
|
|
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
|
|
Also improved --install-hook unit tests
|
|
- 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
|
|
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.
|
|
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.
|
|
Still missing unit tests, documentation. Needs more overall testing.
|