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

Apply assorted repo-review rules #1063

Merged
merged 6 commits into from
Aug 6, 2024

Conversation

DimitriPapadopoulos
Copy link
Contributor

https://learn.scientific-python.org/development/guides/repo-review/?repo=pypa%2Fsetuptools_scm&branch=main

Apply repo-review rules PP306, PP307, PP308

PP306: Specifies strict config
--strict-config should be in addopts = [...]. This forces an error if a config setting is misspelled.

PP307: Specifies strict markers
--strict-markers should be in addopts = [...]. This forces all markers to be specified in config, avoiding misspellings.

PP308: Specifies useful pytest summary
An explicit summary flag like -ra should be in addopts = [...] (print summary of all fails/errors).

Apply repo-review rule PC191

PC191: Ruff show fixes if fixes enabled
If --fix is present, --show-fixes must be too.

Apply repo-review rule RF003

RF003: src directory specified if used
Must specify src directory if it exists.

Apply repo-review rule RF103

RF103: pyupgrade must be selected
Must select the pyupgrade UP checks.

PP306: Specifies strict config
`--strict-config` should be in `addopts = [...]`. This forces
an error if a config setting is misspelled.

PP307: Specifies strict markers
`--strict-markers` should be in `addopts = [...]`. This forces
all markers to be specified in config, avoiding misspellings.

PP308: Specifies useful pytest summary
An explicit summary flag like `-ra` should be in `addopts = [...]`
(print summary of all fails/errors).
PC191: Ruff show fixes if fixes enabled
If `--fix` is present, `--show-fixes` must be too.
RF003: src directory specified if used
Must specify `src` directory if it exists.
RF103: pyupgrade must be selected
Must select the pyupgrade `UP` checks.
Copy link
Contributor

@RonnyPfannschmidt RonnyPfannschmidt left a comment

Choose a reason for hiding this comment

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

The tool looks very interesting, I'm going to elevate a bit deeper for some details (for example the insisting on prettier I pre commit even though the pre commit upstream discontinued support)

@henryiii
Copy link
Contributor

henryiii commented Aug 5, 2024

Next release of sp-repoo-review will accept a maintained fork scientific-python/cookie#461 - if you know of other markdown linters/formatters that should be here too, we can add those. You can always ignore / skip checks you don't care about, though, that's very much expected.

Copy link
Contributor

@RonnyPfannschmidt RonnyPfannschmidt left a comment

Choose a reason for hiding this comment

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

Let's add the review pre commit hook and add the necessary ignores

@RonnyPfannschmidt
Copy link
Contributor

With hook 🪝 mean the repo review one

@henryiii
Copy link
Contributor

henryiii commented Aug 5, 2024

@DimitriPapadopoulos
Copy link
Contributor Author

DimitriPapadopoulos commented Aug 6, 2024

I have added the repo-review pre-commit hook, and disabled these rules for now:

pyproject.toml
Lines 31 to 32 in 4a48455

[tool.repo-review]
ignore = ["PP305", "GH103", "GH212", "MY100", "PC111", "PC160", "PC170", "PC180", "PC901"]
  • PP305: Specifies xfail_strict
  • GH103: At least one workflow with manual dispatch trigger
  • GH212: Require GHA update grouping
  • MY100: Uses MyPy (pyproject config)
  • PC111: Uses blacken-docs
  • PC160: Uses a spell checker
  • PC170: Uses PyGrep hooks (only needed if rST present)
  • PC180: Uses a markdown formatter
  • PC901: Custom pre-commit CI message

Copy link
Contributor

@RonnyPfannschmidt RonnyPfannschmidt left a comment

Choose a reason for hiding this comment

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

Thanks 👍🏻

@RonnyPfannschmidt RonnyPfannschmidt merged commit 6eb52e6 into pypa:main Aug 6, 2024
18 checks passed
@DimitriPapadopoulos DimitriPapadopoulos deleted the repo-review branch August 6, 2024 11:14
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.

3 participants