wemake-python-styleguide icon indicating copy to clipboard operation
wemake-python-styleguide copied to clipboard

Create `.. plugincodes` sphinx directive

Open sobolevn opened this issue 5 years ago • 4 comments

It should show:

  1. Current plugin code with WPS prefix, so it would be easier to search
  2. Code changes in history: we have previous_codes property for this

Example: https://github.com/sixty-north/added-value

sobolevn avatar Apr 08 '20 09:04 sobolevn

Hey @sobolevn! This issue looks challenging I would like to work on it if you don't mind :)

skv0zsneg avatar Jun 10 '25 18:06 skv0zsneg

Thank you!

sobolevn avatar Jun 10 '25 22:06 sobolevn

@sobolevn can you please provide an instance of how you what this directive to work? Is it must be something like this?

In .rst:

.. plugincodes:: 215
   :changes-history:

Rendered:

WPS215
- Added in version 0.3.0.
- Changed in version 0.5.0.

Or I missing something?

skv0zsneg avatar Jun 11 '25 20:06 skv0zsneg

It should show all violations for a module in a single format. Basically, just a better version of the current thing.

sobolevn avatar Jun 11 '25 20:06 sobolevn

Hey, @sobolevn! I have some difficulties during explore the Sphinx and docutils. I've came up to two variants of solution:

  1. Build WPS own Sphinx detective with zero another detective dependencies. It will be hard because I must redo the autosummary and autodoc behavior.
  2. Using autosummary and autodoc as deps for plugincodes directive and build everything around them.

What you think we should do?

skv0zsneg avatar Jun 25 '25 20:06 skv0zsneg

Surely 2 :)

sobolevn avatar Jun 25 '25 21:06 sobolevn