-
Notifications
You must be signed in to change notification settings - Fork 32
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
Conversation
c1cd58c
to
27e1fdc
Compare
@@ -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 |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
for arg in "$@" | ||
do | ||
case $arg in | ||
--check-shellscript) check_script;; | ||
--check-commitlint) check_commitlint "$@";; |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
27e1fdc
to
c6d4780
Compare
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.
0c4face
to
7ed5d63
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
No description provided.