[code-quality] Searching multiple setup.cfg files for flake8 section?

Ned Batchelder ned at nedbatchelder.com
Tue Jul 7 15:40:35 CEST 2015



On 7/7/15 5:05 AM, Willy Wu via code-quality wrote:
> Hey all,
>
> We use flake8 at Dropbox and are pretty happy with it.  But one small 
> issue is the way that flake8 configuration gets discovered.  We use 
> the per-project configuration via setup.cfg files which are checked 
> into source control, but flake8 only considers the first setup.cfg in 
> the directory path (regardless of whether it contains a flake8 section 
> or not).  This forces us to duplicate our [flake8] configuration 
> across all of our various setup.cfgs.
>
> Said in crude ascii form, this is a simplified version of our project 
> layout:
> - repo root
>   |- setup.cfg (default values)
>   \- subservice #1
>     \- setup.cfg (which has non-flake8 overrides for subservice #1)
>   \- subservice #2
>     \- setup.cfg (which similarly contains non-flake8 overrides for 
> subservice #2)
>
> But before I go off trying to patch flake8 code, is there relevant 
> background on why you guys don't try to discover the first setup.cfg 
> with a flake8 section, but instead just consider the first encountered 
> setup.cfg?  We've seen teams accidentally break flake8 checking 
> whenever they add setup.cfg files for non-flake8 projects, and the 
> "fix" is to copy/paste the flake8 section into those new files.
>
> Or alternatively, should we be doing something different with our 
> project layout as a workaround?  It's entirely possible that we should 
> be configuring things differently overall...?

I'm interested in this question for coverage.py.  Does setuptools or pip 
examine all of the setup.cfg files in your repo?  I wouldn't have 
guessed it would do that, I thought it would simply read the first one 
it finds.  I've never seen a project laid out like this, so it's all new 
to me.

--Ned.
>
> Thanks!
>
> Willy
>
>
> _______________________________________________
> code-quality mailing list
> code-quality at python.org
> https://mail.python.org/mailman/listinfo/code-quality

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/code-quality/attachments/20150707/9629e035/attachment.html>


More information about the code-quality mailing list