Skip to content

Commit

Permalink
Fix black ignoring files on travis.
Browse files Browse the repository at this point in the history
First, black already parsers .gitignore, so no need for the exclude
option in pyproject.toml (apart from checked in generated files). The
problem with this is that .gitignore has `build/` in it already and
black does not take into account the root of the git repository, but
instead seems to assume the current working directory. Thus work around
this by setting the cwd in eachdist.py.
  • Loading branch information
Oberon00 committed Nov 15, 2019
1 parent e62f5bc commit 4d93900
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 13 deletions.
11 changes: 1 addition & 10 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,7 @@ line-length = 79
exclude = '''
(
/(
\.eggs # exclude a few common directories in the
| \.git # root of the project
| \.hg
| \.mypy_cache
| \.tox
| \.venv.*
| venv.*
| \.vscode
| dist
| ext/opentelemetry-ext-jaeger/src/opentelemetry/ext/jaeger/gen # generated files
ext/opentelemetry-ext-jaeger/src/opentelemetry/ext/jaeger/gen # generated files
)/
)
'''
7 changes: 4 additions & 3 deletions scripts/eachdist.py
Original file line number Diff line number Diff line change
Expand Up @@ -308,14 +308,15 @@ def lint_args(args):

runsubprocess(
args.dry_run,
("black", rootdir)
+ (("--diff", "--check") if args.check_only else ()),
("black", ".") + (("--diff", "--check") if args.check_only else ()),
cwd=rootdir,
check=True,
)
runsubprocess(
args.dry_run,
("isort", "--recursive", rootdir)
("isort", "--recursive", ".")
+ (("--diff", "--check-only") if args.check_only else ()),
cwd=rootdir,
check=True,
)
runsubprocess(args.dry_run, ("flake8", rootdir), check=True)
Expand Down

0 comments on commit 4d93900

Please sign in to comment.