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

User should not configure anything other than the complexity options #164

Closed
sobolevn opened this issue Sep 30, 2018 · 10 comments
Closed

User should not configure anything other than the complexity options #164

sobolevn opened this issue Sep 30, 2018 · 10 comments
Labels
feature New feature or request level:advanced Needs a lot of care

Comments

@sobolevn
Copy link
Member

We should provide default options for isort and flake8.

Related:

  1. Add settings-path option support gforcada/flake8-isort#63
@sobolevn sobolevn added the feature New feature or request label Sep 30, 2018
@sobolevn sobolevn self-assigned this Sep 30, 2018
@sobolevn sobolevn added the level:advanced Needs a lot of care label Oct 5, 2018
@sobolevn sobolevn mentioned this issue Dec 23, 2018
13 tasks
@sobolevn sobolevn removed their assignment Jul 11, 2019
@sobolevn
Copy link
Member Author

See --append-config option that we can monkey-patch.

@sobolevn sobolevn reopened this Jul 13, 2019
@sobolevn
Copy link
Member Author

Closed by a misclick.

@AlwxSin
Copy link
Contributor

AlwxSin commented Jul 13, 2019

That's will force me to not use wps.

This linter is good, very good in comparison with naked flake8 or even with flake8 with plugins. But several rules are very opinionated. And it's good I can disable them, just a few.

@sobolevn
Copy link
Member Author

This is not the point of this issue, I am only talking about configuration options like quotes, max-line-length, isort config and so on.

It is not related to ignore, per-file-ignores or complexity rules.
We also use these settings on literally every project: https://github.com/wemake-services/wemake-python-styleguide/blob/master/setup.cfg#L31-L41

@AlwxSin
Copy link
Contributor

AlwxSin commented Jul 13, 2019

Ah, that's ok =)

@sobolevn
Copy link
Member Author

sobolevn commented Jul 20, 2019

For isort to work we can patch defaults: https://github.com/timothycrosley/isort/blob/develop/isort/settings.py#L76

It is safe, since any custom defined options will take priority over these values.
And since it is just a dict - it is really easy to do.

If they will change the format (I am quite sure that they won't), we can just fix the version of isort.

The only thing I care about is where should we patch it.
We need to do it before flake8-isort plugin starts to work.

I guess that we should do it in the import time. I hope that flake8 import plugins before they are actually executed.
And flake8 plugin API will help us with defining the right moment.

@sobolevn
Copy link
Member Author

@sobolevn
Copy link
Member Author

The obvious problem with patching isort config this way is that it won't work for autoformatter part. isort filename.py won't produce the same results.

I will look into plugin system of isort. Or ugly hacks 🙂

@sobolevn
Copy link
Member Author

sobolevn commented Aug 9, 2019

I guess we have found a solution: https://github.com/andreoliwa/nitpick

@andreoliwa
Copy link

I guess we have found a solution: https://github.com/andreoliwa/nitpick

I'm glad nitpick has a practical use outside my own projects. 🙂
It's still beta and with rough edges though.
Let me know if you find more bugs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request level:advanced Needs a lot of care
Projects
None yet
Development

No branches or pull requests

3 participants