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 Markdown file linter #6895

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

mhucka
Copy link
Contributor

@mhucka mhucka commented Dec 29, 2024

This adds check/markdownlint and a corresponding configuration file .markdownlint.yaml. Running ./check/markdownlint will check all .md files recursively from the top of the source tree, ignoring subdirectories whose names start with a .. Arguments can be passed to the script so that, e.g., ./check/markdownlint somefilename will lint just somefilename.

This adds `check/markdownlint` and a corresponding configuration file
`.markdownlint.yaml`. Running `./check/markdownlint` will check all
`.md` files recursively from the top of the source tree, ignoring
subdirectories whose names start with a `.`. Arguments can be passed
to the script so that, e.g., `./check/markdownlint somefilename` will
lint just _somefilename_.
@CirqBot CirqBot added the size: S 10< lines changed <50 label Dec 29, 2024
Copy link

codecov bot commented Dec 29, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 97.87%. Comparing base (5d317ba) to head (3abda3a).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #6895   +/-   ##
=======================================
  Coverage   97.86%   97.87%           
=======================================
  Files        1084     1084           
  Lines       94406    94406           
=======================================
+ Hits        92395    92396    +1     
+ Misses       2011     2010    -1     

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

Many existing Cirq Markdown files use bare URLs for things like email
addresses, because that's supported by GitHub-flavored Markdown.
@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 tanujkhattar 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
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.

Can we rename the config file to .markdownlintrc?

According to the docs that configuration file would be found by markdownlint from any subdirectory; we could then do without the check/markdownlint script.

Otherwise LGTM.

@mhucka
Copy link
Contributor Author

mhucka commented Jan 11, 2025

Can we rename the config file to .markdownlintrc?

According to the docs that configuration file would be found by markdownlint from any subdirectory; we could then do without the check/markdownlint script.

We can change the config file, but the reason there's a check/markdownlint script is to give it a default argument if the user invokes it simply as check/markdownlint. The behavior of the other scripts like check/pylint is to go from the current directory recursively down. The markdownlint program is unfortunate in always requiring an argument, so just running markdownlint will make it come back with a usage message.

If this difference in behavior (compared to other check/ scripts) is okay, then we don't need check/markdownlint.

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.

3 participants