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

Handle error if commit file not present #44

Closed
aj3sh opened this issue May 24, 2024 · 0 comments · Fixed by #46
Closed

Handle error if commit file not present #44

aj3sh opened this issue May 24, 2024 · 0 comments · Fixed by #46
Labels
bug Something isn't working

Comments

@aj3sh
Copy link
Member

aj3sh commented May 24, 2024

commitlint throws python stack error if commit message file not present.

Steps to Replicate:

commitlint --file /non-existent/file

Observed Behaviour:

Traceback (most recent call last):
  File "/Users/aj3sh/.venv/test/bin/commitlint", line 8, in <module>
    sys.exit(main())
  File "/Users/aj3sh/projects/python/commitlint/src/commitlint/cli.py", line 210, in main
    commit_message = _get_commit_message_from_file(args.file)
  File "/Users/aj3sh/projects/python/commitlint/src/commitlint/cli.py", line 139, in _get_commit_message_from_file
    with open(abs_filepath, encoding="utf-8") as commit_message_file:
FileNotFoundError: [Errno 2] No such file or directory: '/non-existent/file'

Expected Behaviour:
A valid message should be shown in this case.

@aj3sh aj3sh added this to Commitlint May 16, 2024
@aj3sh aj3sh converted this from a draft issue May 24, 2024
@aj3sh aj3sh added the bug Something isn't working label May 24, 2024
@aj3sh aj3sh closed this as completed in #46 May 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

1 participant