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

build: Move lint logic to its own script. #3161

Merged
merged 1 commit into from
Jul 24, 2023

Conversation

davecgh
Copy link
Member

@davecgh davecgh commented Jul 21, 2023

This is rebased on #3157.

This separates the logic in run_tests.sh that runs all of the linters on all modules in the repository to a separate lint.sh script and updates run_tests.sh to call that script instead. Rather than listing every linter in the script comments, it refers to the .golangci.yml configuration file that specifies them now that it exists.

This allows developers to more easily selectively run only the linters without needing to run all of the tests again.

It also cleans up the comments in run_test.sh to match reality while here.

@davecgh davecgh added this to the 1.9.0 milestone Jul 21, 2023
@davecgh davecgh force-pushed the build_separate_lint_script branch 2 times, most recently from c5bd3df to 1e697c8 Compare July 22, 2023 00:00
@jrick
Copy link
Member

jrick commented Jul 24, 2023

This allows developers to more easily selectively run only the linters without needing to run all of the tests again.

this works well to only perform linting while skipping testing, but not to perform tests without performing lints.

Having the lint operations in a separate script is fine, but could we change run_tests.sh to take an (optional) parameter to describe which operation to perform, and default to performing all of them?

Another alternative is an "all.sh" script that does all, and break out tests into another script like this PR currently does for linting.

@davecgh
Copy link
Member Author

davecgh commented Jul 24, 2023

this works well to only perform linting while skipping testing, but not to perform tests without performing lints.

Having the lint operations in a separate script is fine, but could we change run_tests.sh to take an (optional) parameter to describe which operation to perform, and default to performing all of them?

Another alternative is an "all.sh" script that does all, and break out tests into another script like this PR currently does for linting.

Yeah, that was intentional. The lints are part of the tests. I wasn't worried about having a separate test script, because, unlike the linters, it is pretty trivial to selectively run tests with lints with go test nowadays, including for all modules.

I'm not really opposed to having separate scripts for it, but if we decide to go that route, I'd prefer to do it in a separate PR since this solves the immediate thing it sets out to solve as is.

This separates the logic in run_tests.sh that runs all of the linters on
all modules in the repository to a separate lint.sh script and updates
run_tests.sh to call that script instead.  Rather than listing every
linter in the script comments, it refers to the .golangci.yml
configuration file that specifies them now that it exists.

This allows developers to more easily selectively run only the linters
without needing to run all of the tests again.

It also cleans up the comments in run_test.sh to match reality while
here.
@davecgh davecgh force-pushed the build_separate_lint_script branch from 1e697c8 to 6d8707a Compare July 24, 2023 17:24
@davecgh davecgh merged commit 6d8707a into decred:master Jul 24, 2023
2 checks passed
@davecgh davecgh deleted the build_separate_lint_script branch July 24, 2023 17:26
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.

4 participants