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

Stabilize two flake8-pyi rules #12860

Merged
merged 1 commit into from
Aug 13, 2024
Merged

Conversation

MichaReiser
Copy link
Member

Summary

Stabilize PYI057 and PYI62.

The rules have been added more than 90 days ago and there are no outstanding issues (searching by rule name or code).

It is a bit funny that the rules apply to both pyi and py files, considering that they are part of flake8-pyi.
They do match the behavior of the upstream rules and we can move the rules into a more appropriate group when doing the rule categorization.

Test Plan

See ecosystem check

@MichaReiser MichaReiser changed the base branch from main to ruff-0.6 August 13, 2024 12:59
@MichaReiser MichaReiser added the rule Implementing or modifying a lint rule label Aug 13, 2024
Copy link
Contributor

github-actions bot commented Aug 13, 2024

ruff-ecosystem results

Linter (stable)

ℹ️ ecosystem check detected linter changes. (+16 -0 violations, +0 -0 fixes in 2 projects; 52 projects unchanged)

bokeh/bokeh (+1 -0 violations, +0 -0 fixes)

ruff check --no-cache --exit-zero --ignore RUF9 --output-format concise --no-preview --select ALL

+ src/bokeh/events.py:569:36: PYI062 Duplicate literal member `-1`

python/typeshed (+15 -0 violations, +0 -0 fixes)

ruff check --no-cache --exit-zero --ignore RUF9 --output-format concise --no-preview --select E,F,FA,I,PYI,RUF,UP,W

+ stdlib/_collections_abc.pyi:63:24: PYI057 Do not use `typing.ByteString`, which has unclear semantics and is deprecated
+ stubs/tensorflow/tensorflow/compiler/xla/xla_pb2.pyi:1188:11052: PYI062 Duplicate literal member `...`
+ stubs/tensorflow/tensorflow/compiler/xla/xla_pb2.pyi:1188:11057: PYI062 Duplicate literal member `...`
+ stubs/tensorflow/tensorflow/compiler/xla/xla_pb2.pyi:1188:11062: PYI062 Duplicate literal member `...`
+ stubs/tensorflow/tensorflow/compiler/xla/xla_pb2.pyi:1188:11067: PYI062 Duplicate literal member `...`
+ stubs/tensorflow/tensorflow/compiler/xla/xla_pb2.pyi:1188:3422: PYI062 Duplicate literal member `...`
+ stubs/tensorflow/tensorflow/compiler/xla/xla_pb2.pyi:1188:5868: PYI062 Duplicate literal member `...`
+ stubs/tensorflow/tensorflow/compiler/xla/xla_pb2.pyi:1188:5873: PYI062 Duplicate literal member `...`
+ stubs/tensorflow/tensorflow/compiler/xla/xla_pb2.pyi:1188:8355: PYI062 Duplicate literal member `...`
+ stubs/tensorflow/tensorflow/compiler/xla/xla_pb2.pyi:1188:8360: PYI062 Duplicate literal member `...`
+ stubs/tensorflow/tensorflow/compiler/xla/xla_pb2.pyi:1188:8689: PYI062 Duplicate literal member `...`
+ stubs/tensorflow/tensorflow/compiler/xla/xla_pb2.pyi:1188:8694: PYI062 Duplicate literal member `...`
+ stubs/tensorflow/tensorflow/core/protobuf/rewriter_config_pb2.pyi:496:918: PYI062 Duplicate literal member `...`
+ stubs/tensorflow/tensorflow/core/protobuf/rewriter_config_pb2.pyi:496:923: PYI062 Duplicate literal member `...`
+ stubs/tensorflow/tensorflow/core/protobuf/rewriter_config_pb2.pyi:496:928: PYI062 Duplicate literal member `...`

Changes by rule (2 rules affected)

code total + violation - violation + fix - fix
PYI062 15 15 0 0 0
PYI057 1 1 0 0 0

Linter (preview)

✅ ecosystem check detected no linter changes.

@@ -779,9 +779,9 @@ pub fn code_to_rule(linter: Linter, code: &str) -> Option<(RuleGroup, Rule)> {
(Flake8Pyi, "055") => (RuleGroup::Stable, rules::flake8_pyi::rules::UnnecessaryTypeUnion),
(Flake8Pyi, "056") => (RuleGroup::Stable, rules::flake8_pyi::rules::UnsupportedMethodCallOnAll),
(Flake8Pyi, "058") => (RuleGroup::Stable, rules::flake8_pyi::rules::GeneratorReturnFromIterMethod),
(Flake8Pyi, "057") => (RuleGroup::Preview, rules::flake8_pyi::rules::ByteStringUsage),
(Flake8Pyi, "057") => (RuleGroup::Stable, rules::flake8_pyi::rules::ByteStringUsage),
Copy link
Member

Choose a reason for hiding this comment

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

I think this one has been around for a little less than 90 days -- it was merged on May 29 and released on May 31. But it's also a very simple and uncontroversial rule (IMO), so I'm okay with stabilising it a couple of weeks before we normally would 😄 it's not in our versioning policy that we have to wait 90 days

Copy link
Member Author

Choose a reason for hiding this comment

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

Lol, that's correct. I only saw May and was like, that's a long time ago. I did do the proper math for the other rules.

@AlexWaygood
Copy link
Member

I think the ecoystem report has gone haywire because you changed the base branch of the PR after it had been opened. Could you try rebasing it? Or maybe closing and reopening it?

@MichaReiser MichaReiser reopened this Aug 13, 2024
@MichaReiser
Copy link
Member Author

Hmm, I'm trying to reproduce the typeshed errors where the error message looks very off but without success so far

@AlexWaygood
Copy link
Member

Hmm, I'm trying to reproduce the typeshed errors where the error message looks very off but without success so far

If you can't repro them locally, it's probably another case of #11305

@MichaReiser
Copy link
Member Author

Ohh, thanks for pointing that out. I did paste that code snippet into the test and I can't reproduce locally.

@MichaReiser MichaReiser merged commit bfe10d7 into ruff-0.6 Aug 13, 2024
39 checks passed
@MichaReiser MichaReiser deleted the stabilize-two-flake8-pyi-rules branch August 13, 2024 15:14
@MichaReiser MichaReiser mentioned this pull request Aug 13, 2024
AlexWaygood pushed a commit that referenced this pull request Aug 14, 2024
MichaReiser added a commit that referenced this pull request Aug 14, 2024
MichaReiser added a commit that referenced this pull request Aug 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
rule Implementing or modifying a lint rule
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants