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

Add shellcheck for shell script linting #991

Merged
merged 5 commits into from
Mar 3, 2025

Conversation

mhucka
Copy link
Contributor

@mhucka mhucka commented Feb 26, 2025

This adds a job to the CI checks to run a shell script linter.

This adds a config file for .shellcheckrc, and sets a few optional
flags to try to make shellcheck slightly more thorough.
@mhucka mhucka marked this pull request as ready for review February 28, 2025 15:23
@mhucka mhucka requested review from mpharrigan and ncrubin February 28, 2025 15:24
@quantumlib quantumlib deleted a comment from gemini-code-assist bot Feb 28, 2025
@mhucka mhucka added this pull request to the merge queue Mar 2, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Mar 2, 2025
@mhucka mhucka added this pull request to the merge queue Mar 3, 2025
@mhucka mhucka self-assigned this Mar 3, 2025
Merged via the queue into quantumlib:master with commit 13f0c4e Mar 3, 2025
18 checks passed
@mhucka mhucka deleted the mh-add-shellcheck branch March 3, 2025 17:42
mhucka added a commit to mhucka/OpenFermion that referenced this pull request Mar 5, 2025
* Add .shellcheckrc

This adds a config file for .shellcheckrc, and sets a few optional
flags to try to make shellcheck slightly more thorough.

* Add shellcheck problem matcher

* Add a heading to help break up the text a little

* Add shellcheck to CI checks
mhucka added a commit that referenced this pull request Mar 5, 2025
* Run all nightly tests from a common top-level workflow

This removes the individual cron schedule entries from the workflows
that run at night, and instead invokes them from `nightly.yaml`.

* Rename workflows to use .yaml extension consistently

`.yaml` is actually the official file extension for YAML.

* Add OSV scanner workflow

* Adjust names and trigger conditions

* Tell yamllint the long lines are okay

* Rework organization some more

* Set up another problem matcher

* Add .editorconfig file (#990)

This adds settings based on some common-sense values and the
OpenFermion project's current conventions, such as line length and use
of spaces instead of tabs.

* Add shellcheck for shell script linting (#991)

* Add .shellcheckrc

This adds a config file for .shellcheckrc, and sets a few optional
flags to try to make shellcheck slightly more thorough.

* Add shellcheck problem matcher

* Add a heading to help break up the text a little

* Add shellcheck to CI checks

* Edit CONTRIBUTING.md (#993)

This adds a warning about the CLA implications for GenAI code, and
tries to add some more info about the contribution process.

* Add markdownlint config file (#995)

This adds a `.markdownlintrc` configuration file for
[markdownlint](https://github.com/igorshubovych/markdownlint-cli), a
popular linter for Markdown files. The settings here try to be as
close to the Google style as possible while still being compatible
with GitHub-flavored Markdown.

This same markdownlint file is used in Cirq and other Quantumlib
projects.

* Fix warnings reported by shellcheck (#997)

There are no functional changes in this commit; all changes are to
address lint reported by shellcheck.

* CI checks need to be run if ci.yml changes (#998)

The tests for changed files needs to consider changes to the workflow
definitions too, because a change to the workflow definition could
involve changing options or other aspects of the CI tests that might
change the check results.

* Add problem matchers for Mypy, Pytest, and Black (#1000)

* Add problem matchers for mypy and pytest

* Add problem matcher for Black

* Pass input sha to format-incremental

If the user supplied a sha in a manual workflow run, we need to pass
that to `format-incremental` or else it won't compare files to the
correct revision.

* Prefer single quotes in YAML

Due to how GitHub Actions syntax works, I'm finding it safer to use
single quotes for YAML values and (usually) double quotes in shell
scripts.

* Tighten format of "run:" for one-liners

It seems slightly reasier to read the code whenn single-line shell
commands are put on the same line as the `run:`, instead of being put
on a separate line.

* More setup, editing, configuration, renaming, tweaking
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants