Comments (6)
Using the setup.cfg
at the project root is the pythonic way, but other tools follow other strategies. Note that the quoted pep8 also supports ~/.config/pep8
outing it as a Unix-y/Linux-y tool, nose supports an rc or cfg file at ~ in addition to a section in the setup.cfg. Since some tools that are useful to python projects are not python-specific, other ways are chosen. Travis for example uses a YAML file at the project root in contrast to the ini-style configs of all others. Likewise although being ini-style, Git uses specific files to store some information; the .gitmodules
and .gitattributes
for example. I think projects may choose different ways of integrating the tools they need and to be as compatible as possible, a tool that aims to be used broadly needs to implement at least a few ways of configuration. Depending on your tools, using only a setup.cfg
might be possible, in other cases you will currently end up with various different config files in the project root, not only rc files. In the latter case it might be better to have one config file per tool to at least keep some level of consistency.
from isort.
Agreed - as a concrete example, I was thinking it might be nice to collect
this sort of project βpolicyβ into a single setup.cfg file to reduce the
odds of, say, someone updating the module exclude list for the tool they
use but missing something else. I definitely wouldn't want to lose the
ability for you to have a config file in your home directory with your
personal styles but it makes sense for an open-source project to be able to
override those defaults for consistency.
Chris
from isort.
True, in an ideal world each project had a single config file, overriding user-level presets. This should be the goal to aim for, but one has to accept the fact that there are other tools with odd ways of configuration. I think at least a a section the setup.cfg at project level and an individual file at project level as well as at the user level should be supported.
from isort.
I think this is a good idea, and certainly will add support for it in the next release. Enabling a single project config is really a good goal, and I added editorconfig support for this reason. I think it just makes sense to extend this support to the more pythonic setup.cfg as well, really glad you made me aware of this approach.
Thanks!
~Timothy
from isort.
Support for setup.cfg based configuration has been added in release 3.3.0.
Thanks again!
~Timothy
from isort.
Awesome, thanks!
from isort.
Related Issues (20)
- `--skip-gitignore` still traverses files/directories in .gitignore'd directories HOT 2
- Sorting order is broken and not following standard sort order HOT 13
- Third-party incorrectly identify as First-party depending on the name of the root directory
- isort.core.process incorrectly returns False if only changes to lines before imports were made, with no changes to raw import section
- Ran into `ERROR: Unrecoverable exception thrown when parsing <filepath>`
- Feature Request: Improved Handling of `# type: ignore` Comments to Preserve Mypy Compatibility HOT 1
- Different order on same file depending on where you execute isort v5.13.2 HOT 1
- THIRDPARTY module detected as FIRSTPARTY when import happens within subdir of same name
- Black line length config support when using `--profile black`? HOT 1
- isort does not recognize _collections_abc as part of the standard library HOT 1
- Unrecoverable exception thrown using --sort-reexports
- Feature Request: Automatic Conversion of Relative Imports to Absolute Imports
- isort doesn't format the imports in PyCharm's Jupyter notebooks
- False order of local imports relative to standard library imports
- Circular Import Issue Due to Import Reordering in Python 3.8
- Bug : isort add empty lines before pylint comments
- Deprecate `setuptools` integration comand
- Docs: GitHub action and Pre-commit need better configuration/args examples HOT 1
- Bug: Word wrapping works incorrectly with force_single_line=True
- isort breaks the code with sort_reexports = true HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from isort.