Skip to content

Commit

Permalink
Bugfix: use DEFAULT_ENCODING for --msg-filename (#325)
Browse files Browse the repository at this point in the history
This fixes encoding issues which occur more commonly when invoking the
commit-msg hook on Windows.

Fixes #310
  • Loading branch information
jorisroovers authored Aug 26, 2022
1 parent f487d32 commit 57c6864
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion gitlint-core/gitlint/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,8 @@ def __init__(self, config, config_builder, commit_hash, refspec, msg_filename, g
@click.option('--ignore', envvar='GITLINT_IGNORE', default="", help="Ignore rules (comma-separated by id or name).")
@click.option('--contrib', envvar='GITLINT_CONTRIB', default="",
help="Contrib rules to enable (comma-separated by id or name).")
@click.option('--msg-filename', type=click.File(), help="Path to a file containing a commit-msg.")
@click.option('--msg-filename', type=click.File(encoding=gitlint.utils.DEFAULT_ENCODING),
help="Path to a file containing a commit-msg.")
@click.option('--ignore-stdin', envvar='GITLINT_IGNORE_STDIN', is_flag=True,
help="Ignore any stdin data. Useful for running in CI server.")
@click.option('--staged', envvar='GITLINT_STAGED', is_flag=True,
Expand Down

0 comments on commit 57c6864

Please sign in to comment.