From 5ceed95b7e97795dbb00fd33dcf75877656840b5 Mon Sep 17 00:00:00 2001 From: Matt Roeschke Date: Sun, 29 Jul 2018 18:08:06 -0700 Subject: [PATCH] Lint configuration followup --- ci/lint.sh | 11 +++++++++++ ci/requirements_dev.txt | 3 ++- setup.cfg | 7 ++++++- 3 files changed, 19 insertions(+), 2 deletions(-) diff --git a/ci/lint.sh b/ci/lint.sh index 9fc283c04f09e..ec99e1e559d6e 100755 --- a/ci/lint.sh +++ b/ci/lint.sh @@ -8,6 +8,17 @@ RET=0 if [ "$LINT" ]; then + # We're ignoring the following codes across the board + #E402, # module level import not at top of file + #E731, # do not assign a lambda expression, use a def + #E741, # do not use variables named 'l', 'O', or 'I' + #W503, # line break before binary operator + #C405, # Unnecessary (list/tuple) literal - rewrite as a set literal. + #C406, # Unnecessary (list/tuple) literal - rewrite as a dict literal. + #C408, # Unnecessary (dict/list/tuple) call - rewrite as a literal. + #C409, # Unnecessary (list/tuple) passed to tuple() - (remove the outer call to tuple()/rewrite as a tuple literal). + #C410 # Unnecessary (list/tuple) passed to list() - (remove the outer call to list()/rewrite as a list literal). + # pandas/_libs/src is C code, so no need to search there. echo "Linting *.py" flake8 pandas --filename=*.py --exclude pandas/_libs/src --ignore=C405,C406,C408,C409,C410,E402,E731,E741,W503 diff --git a/ci/requirements_dev.txt b/ci/requirements_dev.txt index 83ee30b52071d..c89aae8f2ffca 100644 --- a/ci/requirements_dev.txt +++ b/ci/requirements_dev.txt @@ -1,8 +1,9 @@ # This file was autogenerated by scripts/convert_deps.py # Do not modify directly -Cython +Cython>=0.28.2 NumPy flake8 +flake8-comprehensions moto pytest>=3.1 python-dateutil>=2.5.0 diff --git a/setup.cfg b/setup.cfg index 9ec967c25e225..d00d527da49e2 100644 --- a/setup.cfg +++ b/setup.cfg @@ -16,7 +16,12 @@ ignore = E402, # module level import not at top of file E731, # do not assign a lambda expression, use a def E741, # do not use variables named 'l', 'O', or 'I' - W503 # line break before binary operator + W503, # line break before binary operator + C405, # Unnecessary (list/tuple) literal - rewrite as a set literal. + C406, # Unnecessary (list/tuple) literal - rewrite as a dict literal. + C408, # Unnecessary (dict/list/tuple) call - rewrite as a literal. + C409, # Unnecessary (list/tuple) passed to tuple() - (remove the outer call to tuple()/rewrite as a tuple literal). + C410 # Unnecessary (list/tuple) passed to list() - (remove the outer call to list()/rewrite as a list literal). max-line-length = 79 [yapf]