Config files should be read bottom-up #133

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

Projects

None yet

2 participants

@Nurdok
Member
Nurdok 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
Member
Nurdok 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
Member
Nurdok commented Sep 22, 2015

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

@farmersez
Contributor

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 Nurdok closed this Oct 4, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment