Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

User-defined rules not working on Windows #107

Closed
jorisroovers opened this issue Nov 3, 2019 · 2 comments
Closed

User-defined rules not working on Windows #107

jorisroovers opened this issue Nov 3, 2019 · 2 comments
Labels
question windows Windows related issues

Comments

@jorisroovers
Copy link
Owner

Hello,

I tried creating user-defined rules on a Windows host (using Git-Bash) and those are not discovered.
I have created a CommitRule UC1 based on one of your examples.

Do you experience the same behavior?

$ gitlint --debug --extra-path myextensions/rules.py
DEBUG: gitlint.cli To report issues, please visit https://github.com/jorisroovers/gitlint/issues
DEBUG: gitlint.cli Platform: Windows-10-10.0.17763
DEBUG: gitlint.cli Python version: 2.7.16 (v2.7.16:413a49145e, Mar  4 2019, 01:37:19) [MSC v.1500 64 bit (AMD64)]
DEBUG: gitlint.cli Git version: git version 2.18.0.windows.1
DEBUG: gitlint.cli Gitlint version: 0.12.0
DEBUG: gitlint.cli GITLINT_USE_SH_LIB: [NOT SET]
DEBUG: gitlint.cli Configuration
config-path: C:\Users\xyz\path\.gitlint
[GENERAL]
extra-path: C:\Users\xyz\path\myextensions\rules.py
contrib: [u'contrib-title-conventional-commits']
ignore:
ignore-merge-commits: True
ignore-fixup-commits: True
ignore-squash-commits: True
ignore-stdin: True
verbosity: 3
debug: True
target: C:\Users\xyz\path
[RULES]
  I1: ignore-by-title
     ignore=all
     regex=^Release(.*)
  I2: ignore-by-body
     ignore=all
     regex=None
  T1: title-max-length
     line-length=70
[...]
  CT1: contrib-title-conventional-commits
     types=build,ci,doc,feat,fix,perf,refactor,style,test
[...]

Originally posted by @ttwister in #20 (comment)

@ttwister ttwister mentioned this issue Nov 3, 2019
@jorisroovers jorisroovers added question windows Windows related issues labels Nov 3, 2019
@jorisroovers
Copy link
Owner Author

@ttwister I just tried this on Windows 10 (python 2.7) against the master branch of gitlint itself, and it works for me if I use --ignore-stdin to work around #91.

Administrator@EC2AMAZ-SLPGD0V MINGW64 /C/Users/Administrator/gitlint (master)
$ gitlint --ignore-stdin --extra-path examples/my_commit_rules.py
1: UC1 Body contains too many lines (14 > 3)
1: UC2 Body does not contain a 'Signed-Off-By' line

Also worked on regular CMD (without --ignore-stdin):

(.venv) C:\Users\Administrator\gitlint>gitlint --extra-path examples\my_commit_rules.py
1: UC1 Body contains too many lines (14 > 3)
1: UC2 Body does not contain a 'Signed-Off-By' line

@jorisroovers
Copy link
Owner Author

Since this issue has been stale for a while and I can't reproduce this, I'm closing this out. Please feel free to open a new issue if required.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question windows Windows related issues
Projects
None yet
Development

No branches or pull requests

1 participant