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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add full violations codes to docs #2409

Merged
merged 15 commits into from Apr 30, 2022

Conversation

Bobronium
Copy link
Contributor

@Bobronium Bobronium commented Apr 28, 2022

I made full violations codes indexable

Finally, people searching for WPS527 Sovereign Starter Motor will see that WPS truly means!
image

Changes

  • Full code is now prepended to BaseViolation.__doc__
  • Full code is added to BaseViolation.full_code class var
  • Summary is added to BaseViolation.summary class car
  • BaseViolation._full_name is now a classmethod

How it looks in docs

image

image

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 #2288
Closes #1145

馃檹 Please, if you or your company is finding wemake-python-styleguide valuable, help us sustain the project by sponsoring it transparently on https://opencollective.com/wemake-python-styleguide. As a thank you, your profile/company logo will be added to our main README which receives hundreds of unique visitors per day.

@Bobronium Bobronium changed the title Add full code to __doc__ and attribute Add full code to docs Apr 28, 2022
@Bobronium Bobronium changed the title Add full code to docs Add full violations codes to docs Apr 28, 2022
@Bobronium Bobronium marked this pull request as ready for review April 28, 2022 15:12
Copy link
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.

Thank you, this is amazing!

There are several nitpicks about code style, but other than that - I am happy to merge this! 馃帀

wemake_python_styleguide/violations/base.py Outdated Show resolved Hide resolved
wemake_python_styleguide/violations/base.py Outdated Show resolved Hide resolved
wemake_python_styleguide/violations/base.py Outdated Show resolved Hide resolved
wemake_python_styleguide/violations/base.py Outdated Show resolved Hide resolved
wemake_python_styleguide/violations/base.py Outdated Show resolved Hide resolved
Bobronium and others added 7 commits April 29, 2022 13:51
# We use this code to show base metrics and thresholds mostly:
postfix_template: ClassVar[ViolationPostfixes] = (
ViolationPostfixes.bigger_than
)

def __init_subclass__(cls) -> None:
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This causes WPS338 error. Considering that #2411 is in place, what should be our course of action?

I see the following options:

  1. Suppress the error until Add __init_subclass__ to the methods order聽#2411 gets released
  2. Obey current rules of ordering, refactor once Add __init_subclass__ to the methods order聽#2411 gets released
  3. Do nothing, wait until Add __init_subclass__ to the methods order聽#2411 gets released

@Bobronium
Copy link
Contributor Author

Sorry for the initial mess. I believe now the only thing that would make CI unhappy is WPS338 (#2409 (comment))

@codecov
Copy link

codecov bot commented Apr 30, 2022

Codecov Report

Merging #2409 (f50d95c) into master (3daaea4) will not change coverage.
The diff coverage is 100.00%.

@@            Coverage Diff            @@
##            master     #2409   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files          120       120           
  Lines         6408      6425   +17     
  Branches      1445      1447    +2     
=========================================
+ Hits          6408      6425   +17     
Impacted Files Coverage 螖
wemake_python_styleguide/violations/base.py 100.00% <100.00%> (酶)
wemake_python_styleguide/visitors/ast/classes.py 100.00% <0.00%> (酶)
wemake_python_styleguide/violations/consistency.py 100.00% <0.00%> (酶)

Continue to review full report at Codecov.

Legend - Click here to learn more
螖 = absolute <relative> (impact), 酶 = not affected, ? = missing data
Powered by Codecov. Last update 3daaea4...f50d95c. Read the comment docs.

@sobolevn
Copy link
Member

Thank you!

@sobolevn sobolevn merged commit 7220df1 into wemake-services:master Apr 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants