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

Config files should be read bottom-up #133

Closed
Nurdok opened this issue Sep 17, 2015 · 3 comments

Comments

Projects
None yet
2 participants
@Nurdok
Copy link
Member

commented Sep 17, 2015

Right now, pep257 reads config files from the directory of the common ancestor of the checked files, and goes on up and up, reading available config files as it goes. The problem here is that the correct semantic is that the closer a config file is to the checked file, the more priority it should get.

So a config file at the top of the repo should be overridden by a config file in the same directory of the checked file.

@Nurdok Nurdok added this to the Next release milestone Sep 17, 2015

@Nurdok

This comment has been minimized.

Copy link
Member Author

commented Sep 22, 2015

There is also another complicated issue that should be fixed regarding this.
Consider the following directory structure:

A
+-- tox.ini
+-- B
    +-- tox.ini

If A/tox.ini contains ignore=D100 and B/tox.ini contains convention=pep257, the D100 error code should be checked. Meaning, it's not enough that closer-to-the-file config files should override same-flag values for more remote config files, but it should be done in a smart way such that any of select, ignore or convention override any of select, ignore or convention flags.

@Nurdok

This comment has been minimized.

Copy link
Member Author

commented Sep 22, 2015

All the while, add-select and add-ignore should be cumulative.

@shacharoo

This comment has been minimized.

Copy link
Member

commented Sep 24, 2015

There should be a way to define "the top of the repo". My repo might be located within a "dirty" directory that contains temporary files, one of whom might be a sample tox.ini i'd like to keep there for some reason.

Nurdok added a commit that referenced this issue Oct 4, 2015

Merge pull request #138 from farmersez/nested-config-files
#133 - Better handling of configuration from files and CLI.

@Nurdok Nurdok closed this Oct 4, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.