Open webknjaz opened 5 years ago
If somebody wants to contribute, here's what to do:
pip install wemake-python-styleguide
flake8 .
Awesome news! Good to know that you find my project useful! 🚀 Any required help from my side?
@sobolevn thanks for the kind offer! I think the only thing we need is more free time to fully implement the style. So we probably just need more PRs with adjustments.
On the second thought, we should probably generate a flakehell baseline and add wemake-python-styleguide
@ https://github.com/cherrypy/cheroot/blob/85a190f/.pre-commit-config.yaml#L17 already.
@sobolevn I tried following https://wemake-python-stylegui.de/en/latest/pages/usage/integrations/flakehell.html but none of flakehell baseline
/flakehell lint
output anything and both return success (code 0). When I just run flake8
, it outputs a number of violations and the return code is 1.
Any pointers?
Try flakehell baseline > .flakehell_baseline
And then add
[tool.flakehell]
baseline = ".flakehell_baseline"
into pyproject.toml
It should work afterwards, if not - then it is a bug in flakehell
@sobolevn that's the problem: flakehell baseline
doesn't print anything to stdout and redirecting it to a file just produces an empty file.
@webknjaz can you please open a new bug report to flakehell
? That's a bug 😞
@sobolevn I've discovered that it supports -vv
arg and it got more interesting.
$ flakehell lint -vv
So the above hinted be to look at configs and eventually I landed here: https://flakehell.readthedocs.io/config.html. Adding the example helped. So I guess it needs [tool.flakehell.plugins]
in pyproject.toml
to work.
@sobolevn https://wemake-python-stylegui.de/en/latest/pages/usage/integrations/flakehell.html only offers to add something to pyproject.toml
after running flakehell baseline
. It looks like this needs to be fixed in the guide.
@sobolevn oh and the default config seems to yell at assert
statements in tests which are mandatory in pytest ecosystem. Is there a mainstream way to disable this? Any option in wemake-python-styleguide to specify that some directories contain tests?
@webknjaz thanks! Are you will to update our docs? I always welcome new contributors! 🎉 Thanks!
About assert
s, yes I use this technique: https://github.com/wemake-services/wemake-python-styleguide/blob/master/setup.cfg#L55 So, tests will have their own set of rules.
Or you can even create a separate setup.cfg
for tests. That's how I work with js
: https://github.com/wemake-services/wemake-vue-template/blob/master/template/tests/.eslintrc.js
Sorry, I don't have time to contribute to the docs so I can't promise you that. I just wanted to flag it to you so you'd be aware of the problem.
I'll keep exploring to see if I can fully integrate the style soon.
One more question — should I always run flakehell
instead or flake8
or can it be picked up automatically somehow?
@sobolevn I'm trying to use .flake8
file solely for the Flake8 configuration. When I run flake8
, it respects per-file-ignores
setting but when I run flakehell lint
it doesn't. Looks like a bug in flakehell.
@sobolevn per-file-ignores
looks like a blocker here. Any advice?
I hope to finish this task soon https://gitlab.com/pycqa/flake8/issues/602
I have many requests for legacy-first native integrations.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
@sobolevn any luck with that?
Not yet, I will be working on it as a part of 0.15
release.
Currently we are working on 0.14
with python3.8
support.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
https://github.com/life4/flakehell/pull/40#issuecomment-630907068 -> time to look at flakehell>=0.4.0
again...
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
❓ I'm submitting a ...
🐞 Is your feature request related to a problem? Please describe.
The code style is not consistent across the project.
🐣 Describe the solution you'd like
Integrate a set of very linters to keep the style in a good shape of .
First, we need to create a legacy style baseline as per https://wemake-python-stylegui.de/en/latest/pages/usage/integrations/legacy.html and then gradually eliminate linter offenses.
This would be a great first issue for beginners.
We may need to adjust a few rules along the way, though.
📋 Describe alternatives you've considered
N/A
📋 Additional context
See also: https://wemake-python-stylegui.de/en/latest/pages/usage/integrations/flakehell.html#flakehell