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 OSV code scanner and make minor adjustments to CI #992

Merged
merged 17 commits into from
Mar 5, 2025

Conversation

mhucka
Copy link
Contributor

@mhucka mhucka commented Feb 27, 2025

This reorganizes the nightly CI workflow to be more modular. It also adds the scanner for the Open Source Vulnerabilities (OSV) database.

This removes the individual cron schedule entries from the workflows
that run at night, and instead invokes them from `nightly.yaml`.
`.yaml` is actually the official file extension for YAML.
@mhucka mhucka marked this pull request as ready for review February 27, 2025 22:50
@quantumlib quantumlib deleted a comment from gemini-code-assist bot Feb 28, 2025
@mhucka mhucka marked this pull request as draft March 4, 2025 17:21
@mhucka mhucka self-assigned this Mar 4, 2025
mhucka added 12 commits March 5, 2025 13:59
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 .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
This adds a warning about the CLA implications for GenAI code, and
tries to add some more info about the contribution process.
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.
There are no functional changes in this commit; all changes are to
address lint reported by shellcheck.
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 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.
@mhucka mhucka marked this pull request as ready for review March 5, 2025 23:25
@mhucka mhucka merged commit 794cd10 into quantumlib:master Mar 5, 2025
18 checks passed
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.

1 participant