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

gitlint failed with configured commentchar #59

Closed
DronMDF opened this issue Mar 7, 2018 · 2 comments
Closed

gitlint failed with configured commentchar #59

DronMDF opened this issue Mar 7, 2018 · 2 comments

Comments

@DronMDF
Copy link

DronMDF commented Mar 7, 2018

$ gitlint
Traceback (most recent call last):
  File "/usr/local/bin/gitlint", line 7, in <module>
    from gitlint.cli import cli
  File "/usr/local/lib/python3.6/dist-packages/gitlint/cli.py", line 27, in <module>
    from gitlint.git import GitContext, GitContextError, git_version
  File "/usr/local/lib/python3.6/dist-packages/gitlint/git.py", line 59, in <module>
    class GitCommitMessage(object):
  File "/usr/local/lib/python3.6/dist-packages/gitlint/git.py", line 66, in GitCommitMessage
    COMMENT_CHAR = git_commentchar()
  File "/usr/local/lib/python3.6/dist-packages/gitlint/git.py", line 54, in git_commentchar
    if commentchar.exit_code == 1:  # pylint: disable=no-member
AttributeError: 'str' object has no attribute 'exit_code'
@jorisroovers
Copy link
Owner

I think this is a duplicate of #48 which got merged but hasn't been released to pypi yet. Can you try installing from master and try again?

pip install git+https://github.com/jorisroovers/gitlint.git

@jorisroovers
Copy link
Owner

Closing this as a duplicate, let me know if you still encounter the issue with latest master. I hope to roll a release over the next few days that will include the fix.

jorisroovers added a commit that referenced this issue Jun 19, 2019
When a git repository has a custom 'core.commentchar' configured, gitlint wouldn
crash. This was caused by gitlint not properly handling the 'success' case where
'git config' returns an exit code of 0.

In addition, gitlint wouldn't respect the  '—target' parameter to determine the
commentchar, instead just executing the git config in the current working
directory instead of the target directory.

This should fix #59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants