Skip to content

Fixes #3417 #3420#3419

Closed
MIXgleb wants to merge 5 commits intowemake-services:masterfrom
MIXgleb:issue-3417
Closed

Fixes #3417 #3420#3419
MIXgleb wants to merge 5 commits intowemake-services:masterfrom
MIXgleb:issue-3417

Conversation

@MIXgleb
Copy link
Copy Markdown
Contributor

@MIXgleb MIXgleb commented May 16, 2025

I have made things!

Checklist

  • I have double checked that there are no unrelated changes in this pull request (old patches, accidental config files, etc)
  • I have created at least one test case for the changes I have made
  • I have updated the documentation for the changes I have made
  • I have added my changes to the CHANGELOG.md

Related issues

Closes #3417 #3420

Hi,

  • I've removed the unnecessary WPS604 and WPS614 rules from the noqa.py
  • I've added variation to the rule WPS466.
    Now, for python312+ it is allowed to use [] in decorators due to the PEP 695

@MIXgleb MIXgleb changed the title Fixes #3417 Fixes #3417 #3420 May 16, 2025
Copy link
Copy Markdown
Member

@sobolevn sobolevn left a comment

Choose a reason for hiding this comment

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

Thanks!

Comment thread CHANGELOG.md
- Fixes `WPS432`, now it ignores magic numbers in `Literal`, #3397


## 1.1.1
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Let's add it to the latest WIP version: 1.2.0
I can't support multiple bugfix releases realistically.

Comment thread CHANGELOG.md
Due to PEP 695, it's now allowed to use [] in the decorator only for `python3.12+`.

```python
@decorator[T, V]
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
@decorator[T, V]
@MyClassDecorator[T, V]

Comment thread CHANGELOG.md
- Removes unnecessary WPS604 and WPS614 rules from the noqa.py, #3420
- Fixes `NewStyledDecoratorViolation` for generic type specifications `my_func[T]`, #3417

Due to PEP 695, it's now allowed to use [] in the decorator only for `python3.12+`.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
Due to PEP 695, it's now allowed to use [] in the decorator only for `python3.12+`.
Due to PEP-695, it's now allowed to use `[]` in the decorator only for `python3.12+`.

"""

if sys.version_info >= (3, 12):
wrong_decorators = [
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Create common lists of wrong and correct decorators. Then extend them with version specific ones.

def my_function(): ...

Only for ``python3.12+``
@decorator[my_type](args)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Please, use examples with clear classes, not functions. As I've shown above

@MIXgleb MIXgleb closed this May 19, 2025
@MIXgleb MIXgleb deleted the issue-3417 branch May 19, 2025 10:58
@sobolevn
Copy link
Copy Markdown
Member

why did you close it? 🤔

@MIXgleb
Copy link
Copy Markdown
Contributor Author

MIXgleb commented May 19, 2025

I don't like 'dirty' commits when there are too many for one simple update.
I will open a new PR with all the specified fixes soon)

@sobolevn
Copy link
Copy Markdown
Member

@MIXgleb please, don't do this :) It is easier for me to review everything is one place.

@MIXgleb MIXgleb mentioned this pull request May 19, 2025
4 tasks
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.

WPS466 NewStyledDecoratorViolation issue

2 participants