Skip to content

Commit c2a5048

Browse files
committed
update flake8 configuration and ci
1 parent 0a90a80 commit c2a5048

File tree

5 files changed

+20
-14
lines changed

5 files changed

+20
-14
lines changed

.pre-commit-config.yaml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,19 @@ repos:
44
hooks:
55
- id: isort
66
- repo: https://github.com/ambv/black
7-
rev: stable
7+
rev: 19.10b0
88
hooks:
99
- id: black
1010
- repo: https://gitlab.com/pycqa/flake8
11-
rev: 3.7.7
11+
rev: 3.8.1
1212
hooks:
1313
- id: flake8
14+
alias: flake8
15+
name: flake8
16+
args: ["--config=python/.flake8"]
17+
types: [python]
1418
- repo: https://gitlab.com/pycqa/flake8
15-
rev: 3.7.7
19+
rev: 3.8.1
1620
hooks:
1721
- id: flake8
1822
alias: flake8-cython

ci/checks/style.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ BLACK=`black --check python`
2222
BLACK_RETVAL=$?
2323

2424
# Run flake8 and get results/return code
25-
FLAKE=`flake8 python`
25+
FLAKE=`flake8 --config=python/.flake8 python`
2626
FLAKE_RETVAL=$?
2727

2828
# Run flake8-cython and get results/return code
@@ -78,4 +78,4 @@ RETVALS=($ISORT_RETVAL $BLACK_RETVAL $FLAKE_RETVAL $FLAKE_CYTHON_RETVAL $CLANG_F
7878
IFS=$'\n'
7979
RETVAL=`echo "${RETVALS[*]}" | sort -nr | head -n1`
8080

81-
exit $RETVAL
81+
exit $RETVAL

python/.flake8

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Copyright (c) 2018, NVIDIA CORPORATION.
2+
3+
[flake8]
4+
exclude = __init__.py
5+
ignore =
6+
# line break before binary operator
7+
W503
8+
# whitespace before :
9+
E203
10+

python/setup.cfg

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,6 @@ versionfile_build = rmm/_version.py
1212
tag_prefix = v
1313
parentdir_prefix = rmm-
1414

15-
[flake8]
16-
exclude = __init__.py
17-
ignore =
18-
# line break before binary operator
19-
W503
20-
# whitespace before :
21-
E203
22-
2315
[isort]
2416
line_length=79
2517
multi_line_output=3

python/setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727

2828
if not os.path.isdir(CUDA_HOME):
2929
raise OSError(
30-
f"Invalid CUDA_HOME: " f"directory does not exist: {CUDA_HOME}"
30+
"Invalid CUDA_HOME: " f"directory does not exist: {CUDA_HOME}"
3131
)
3232

3333
cuda_include_dir = os.path.join(CUDA_HOME, "include")

0 commit comments

Comments
 (0)