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

Support Unicode string in commit message #18

Closed
wants to merge 1 commit into from

Conversation

ZhangYaxu
Copy link

Support Unicode string in commit message.

Error info when commit message content Chinese.
Traceback (most recent call last):
File "/usr/bin/gitlint", line 9, in
load_entry_point('gitlint==0.8.0dev', 'console_scripts', 'gitlint')()
File "/usr/lib/python2.6/site-packages/click-6.6-py2.6.egg/click/core.py", line 716, in call
return self.main(*args, **kwargs)
File "/usr/lib/python2.6/site-packages/click-6.6-py2.6.egg/click/core.py", line 696, in main
rv = self.invoke(ctx)
File "/usr/lib/python2.6/site-packages/click-6.6-py2.6.egg/click/core.py", line 1037, in invoke
return Command.invoke(self, ctx)
File "/usr/lib/python2.6/site-packages/click-6.6-py2.6.egg/click/core.py", line 889, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/usr/lib/python2.6/site-packages/click-6.6-py2.6.egg/click/core.py", line 534, in invoke
return callback(*args, **kwargs)
File "/usr/lib/python2.6/site-packages/click-6.6-py2.6.egg/click/decorators.py", line 17, in new_func
return f(get_current_context(), *args, **kwargs)
File "/usr/lib/python2.6/site-packages/gitlint-0.8.0dev-py2.6.egg/gitlint/cli.py", line 104, in cli
ctx.invoke(lint)
File "/usr/lib/python2.6/site-packages/click-6.6-py2.6.egg/click/core.py", line 534, in invoke
return callback(*args, **kwargs)
File "/usr/lib/python2.6/site-packages/click-6.6-py2.6.egg/click/decorators.py", line 17, in new_func
return f(get_current_context(), *args, **kwargs)
File "/usr/lib/python2.6/site-packages/gitlint-0.8.0dev-py2.6.egg/gitlint/cli.py", line 128, in lint
linter.print_violations(violations)
File "/usr/lib/python2.6/site-packages/gitlint-0.8.0dev-py2.6.egg/gitlint/lint.py", line 78, in print_violations
self.display.eee("{0}: {1} {2}: "{3}"".format(v.line_nr, v.rule_id, v.message, v.content), exact=True)
UnicodeEncodeError: 'ascii' codec can't encode characters in position 5-6: ordinal not in range(128)

@jorisroovers
Copy link
Owner

Thanks for submitting this. We have a similar unicode support issue with #16. I'm going to look into this for the upcoming release which I've started working on. My goal is to get it out before the end of the year.

@ZhangYaxu ZhangYaxu closed this Dec 19, 2016
jorisroovers pushed a commit that referenced this pull request Dec 30, 2016
The 0.8.0 release is a significant release that has been in the works
for a long time. Special thanks to Claymore, gernd and ZhangYaxu for submitting
bug reports and pull requests.

- Full unicode support: you can now lint messages in any language! This
  fixes #16 and #18.
- User-defined rules: you can now define your own custom rules
  if you want to extend gitlint's functionality.
- Pypy2 support!
- Debug output improvements: Gitlint will now print your active
  configuration when using --debug
- The general.target option can now also be set via -c flags
  or a .gitlint file
- Bugfixes:
    - Various important fixes related to configuration precedence
    - #17: Body MinLength is not working properly.
      **Behavior Change**: Gitlint now always applies this rule, even if
      the body has just a single line of content.
      Also, gitlint now counts the body-length for the entire body, not
      just the length of the first line.
- Various documentation improvements
- Development:
    - Pylint compliance for all supported python versions
    - Updated dependencies to latest versions
    - Various run_tests.sh improvements for developer convenience
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.

2 participants