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 YAML file linter config file #6896

Merged
merged 8 commits into from
Jan 15, 2025
Merged

Conversation

mhucka
Copy link
Contributor

@mhucka mhucka commented Dec 30, 2024

This adds a configuration file .yamllint.yaml so that people can run yamllint to check the YAML files for syntax errors and conformance to style guidelines.

This adds `check/yamllint` and a corresponding configuration file
`.yamllint.yaml`. Running `./check/yamllint` will check all `.yaml`
files recursively from the top of the source tree. Arguments can be
passed to the script so that, e.g., `./check/yamllint somefilename`
will limit action to only the file _somefilename_.
@CirqBot CirqBot added the size: S 10< lines changed <50 label Dec 30, 2024
Copy link

codecov bot commented Dec 30, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 97.87%. Comparing base (0361a81) to head (2b45b08).
Report is 9 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #6896   +/-   ##
=======================================
  Coverage   97.87%   97.87%           
=======================================
  Files        1084     1084           
  Lines       94420    94465   +45     
=======================================
+ Hits        92409    92454   +45     
  Misses       2011     2011           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@mhucka mhucka marked this pull request as ready for review December 30, 2024 05:16
@mhucka mhucka requested review from vtomole and a team as code owners December 30, 2024 05:16
@mhucka mhucka requested a review from fdmalone December 30, 2024 05:16
@mhucka mhucka added the kind/health For CI/testing/release process/refactoring/technical debt items label Dec 31, 2024
@mhucka mhucka self-assigned this Dec 31, 2024
@mhucka mhucka requested a review from pavoljuhas January 7, 2025 16:36
@dstrain115
Copy link
Collaborator

Why do we have this? Are there really that many yaml files in cirq? Is this just linitng the github config files?

@mhucka
Copy link
Contributor Author

mhucka commented Jan 14, 2025

Well, there are also yaml files in docs/

./docs/transform/_index.yaml
./docs/simulate/_index.yaml
./docs/experiments/_index.yaml
./docs/hardware/_index.yaml
./docs/noise/_index.yaml
./docs/build/_index.yaml
./docs/_book.yaml

There is also the CodeCov config file, and there's a bunch in a couple of dev_tools/ subdirectories.

I'm planning to add a pull-requests checks workflow for linting yaml files. The goal of this PR was to get the config yamllint file in place and let people test it out.

mhucka and others added 3 commits January 14, 2025 08:14
Per discussion on PR quantumlib#6895, we decided to work towards removing
unnecessary check/foo scripts in favor of having people run commands
directly.
@mhucka
Copy link
Contributor Author

mhucka commented Jan 14, 2025

Per comment by @pavoljuhas on another issue, I removed the check/yamllint script, so now this PR is only about the config file.

@mhucka mhucka enabled auto-merge (squash) January 14, 2025 20:15
Copy link
Collaborator

@pavoljuhas pavoljuhas left a comment

Choose a reason for hiding this comment

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

Looks good, thank you!

@pavoljuhas
Copy link
Collaborator

As a follow-up we should clean up the detected lint (we have an internal yaml_format tool that should help) and then add a yamllint to the CI workflow and to the check/all script.

Should we create a tracking issue for that?

@mhucka mhucka merged commit df776a0 into quantumlib:main Jan 15, 2025
35 checks passed
@mhucka mhucka changed the title Add YAML file linter Add YAML file linter config file Feb 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/health For CI/testing/release process/refactoring/technical debt items size: S 10< lines changed <50
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants