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

ci: addition of commit message linter #118

Merged
merged 2 commits into from
Jan 9, 2024

Conversation

tiborsimko
Copy link
Member

No description provided.

Copy link

codecov bot commented Dec 13, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (00d7c32) 5.21% compared to head (b87d9e9) 5.21%.

Additional details and impacted files

Impacted file tree graph

@@          Coverage Diff           @@
##           master    #118   +/-   ##
======================================
  Coverage    5.21%   5.21%           
======================================
  Files           5       5           
  Lines         211     211           
======================================
  Hits           11      11           
  Misses        200     200           

@tiborsimko tiborsimko force-pushed the commitlint branch 3 times, most recently from c1cd58c to 27e1fdc Compare December 13, 2023 12:56
@@ -18,7 +42,7 @@ jobs:
- name: Runs shell script static analysis
run: |
sudo apt-get install shellcheck
./run-tests.sh --check-shellscript
./run-tests.sh --check-shellcheck
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are some inconsistencies here and in run-tests.sh, as sometimes we call --check-shellcheck and some other times --check-shellscript. For example, in run_all the function check_shellcheck is called, but there is no function with that name.

PS: should we maybe add also a default case in run-tests.sh to catch typos when calling ./run-tests.sh --check-...? Something like this:

for arg in "$@"
do
    case $arg in
        [...]
        *) echo "invalid argument $arg" && exit 2;;
    esac
done

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wanted to change the command everywhere to have the tool name <-> option name consistency, but apparently forgot some parts. Fixed.

Good idea to do catch-all rule to return error. Added.

run-tests.sh Outdated
Comment on lines 61 to 64
for arg in "$@"
do
case $arg in
--check-shellscript) check_script;;
--check-commitlint) check_commitlint "$@";;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The passing of $@ to the function breaks when multiple operation are requested, like this:

./run-tests.sh --check-pytest --check-commitlint

Maybe we can remove the for loops that iterates over all the arguments? I personally never pass multiple checks at the same time, so maybe also others do not do that?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I'm doing the same as you, so I agree. Changed.

tiborsimko added a commit to tiborsimko/pytest-reana that referenced this pull request Jan 8, 2024
Adds commitlint to check the commit message style against agreed
conventional commits configuration.

Changes script argument values to always use linter names (e.g.
shellcheck).

Changes argument handling to allow only one checking action that can now
accept further optional arguments.
Adds commitlint to check the commit message style against agreed
conventional commits configuration.

Changes script argument values to always use linter names (e.g.
shellcheck).

Changes argument handling to allow only one checking action that can now
accept further optional arguments.
tiborsimko added a commit to tiborsimko/pytest-reana that referenced this pull request Jan 8, 2024
@tiborsimko tiborsimko force-pushed the commitlint branch 2 times, most recently from 0c4face to 7ed5d63 Compare January 8, 2024 18:25
tiborsimko added a commit to tiborsimko/pytest-reana that referenced this pull request Jan 8, 2024
Copy link
Member

@mdonadoni mdonadoni left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@tiborsimko tiborsimko merged commit b87d9e9 into reanahub:master Jan 9, 2024
17 checks passed
@tiborsimko tiborsimko deleted the commitlint branch January 9, 2024 16:17
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