Maximum attenuation line length?

I use the Flake8 git hook in my project, and I want to reduce the string length limit, but only for one project. Given that there is no clear API for this, how can I do this to modify this application? Also, is there a git -config parameter or environment variable that would allow me to set this? Here's the hook source code:

#!/usr/bin/env python
import os
import sys
import logging
import os.path as P

from flake8.main import git


if __name__ == '__main__':
    ret = git.hook(
        strict=git.config_for('strict'),
        lazy=git.config_for('lazy'),
    )
    if ret:
        sys.exit(ret)
+4
source share
1 answer

Use a file setup.cfgin every project. This file is read by various Python related tools, including pep8 (see pep8 documentation ) and flake8.

setup.cfg flake8 Flake8.

, setup.cfg (, 99 ):

[flake8]
max-line-length = 99
+11

Source: https://habr.com/ru/post/1670213/


All Articles