Skip to content

Commit 8e21ac0

Browse files
authored
Merge pull request #4 from LexMachinaInc/flake8-args-handling
Flake8 args handling
2 parents 82791cb + fd4c072 commit 8e21ac0

File tree

2 files changed

+5
-8
lines changed

2 files changed

+5
-8
lines changed

flake8_per_file/__init__.py

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,11 @@ def main():
2828

2929
all_output = ''
3030
returncode = 0
31-
flake_args = []
32-
for arg in sys.argv[1:]:
33-
if arg.startswith('-'):
34-
flake_args.append(arg)
35-
continue
36-
31+
flake_args = [arg for arg in sys.argv[1:] if not pathlib.Path(arg).exists()]
32+
filenames = [arg for arg in sys.argv[1:] if pathlib.Path(arg).exists()]
33+
for filename in filenames:
3734
sp_result = subprocess.run(
38-
[my_flake8, *flake_args, *find_cfg(arg), arg],
35+
[my_flake8, *flake_args, *find_cfg(filename), filename],
3936
stdout=subprocess.PIPE,
4037
stderr=subprocess.STDOUT,
4138
encoding='utf8',

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "flake8_per_file"
3-
version = "0.4.1"
3+
version = "0.5.0"
44
description = "Per file flake8"
55
authors = ["Gavin Carothers <[email protected]>"]
66
license = "Apache-2.0"

0 commit comments

Comments
 (0)