[pre-commit.ci] pre-commit autoupdate#16253
Conversation
updates: - [github.com/astral-sh/ruff-pre-commit: v0.3.0 → v0.3.4](astral-sh/ruff-pre-commit@v0.3.0...v0.3.4) - [github.com/scientific-python/cookie: 2024.01.24 → 2024.03.10](scientific-python/cookie@2024.01.24...2024.03.10)
|
Thank you for your contribution to Astropy! 🌌 This checklist is meant to remind the package maintainers who will review this pull request of some common things to look for.
|
|
pre-commit auto PR fails pre-commit check? 🤯 |
eerovaher
left a comment
There was a problem hiding this comment.
The Ruff rule UP032 can automatically convert str.format() calls to f-strings. Before v0.3.2 Ruff avoided making changes if the naive conversion produced lines that exceeded the line length limit (88 characters in our case), but now it is more aggressive. I am not convinced that the automatic edits are the best and I think that manually addressing UP032 would be worth it.
I can't tell what went wrong with sp-repo-review, but it is clear that the failure was catastrophic.
| "{}.__init__ had {} remaining unhandled arguments".format( | ||
| self.__class__.__name__, len(args) | ||
| ) | ||
| f"{self.__class__.__name__}.__init__ had {len(args)} remaining unhandled arguments" |
There was a problem hiding this comment.
This can be shortened slightly:
| f"{self.__class__.__name__}.__init__ had {len(args)} remaining unhandled arguments" | |
| f"{type(self).__name__}.__init__ had {len(args)} remaining unhandled arguments" |
There was a problem hiding this comment.
@eerovaher , does that mean this is another one where someone needs to make extra changes from their fork? If so, I will close this PR without merge. Please advise. Thanks!
There was a problem hiding this comment.
Ruff is converting str.format() calls to f-strings in the simplest possible way, but I don't think that simplest is best in many cases. I will update the relevant code manually.
| "declare_metadata: private-key = {} metadata = {}".format( | ||
| private_key, str(metadata) | ||
| ) | ||
| f"declare_metadata: private-key = {private_key} metadata = {str(metadata)}" |
There was a problem hiding this comment.
This can be shortened:
| f"declare_metadata: private-key = {private_key} metadata = {str(metadata)}" | |
| f"declare_metadata: private-key = {private_key} {metadata = !s}" |
|
Re: repo-review -- maybe @henryiii or @WilliamJamieson can advise? 🙏 |
|
From a local run: We are assuming this is a string: [tool.pytest.ini_options]
minversion = 7.0But it's an float. Does pytest support that? Version numbers aren't floats, generally. I can look into reducing the output, not sure I like Rich's error formatter. |
|
Looks like it is a string if within |
|
I bet it's valid, it probably calls stingifies on everything in |
updates: