style: add a few more checks

This commit is contained in:
Henry Schreiner
2020-08-14 16:12:24 -04:00
parent 448d6538d7
commit 9df68df525
7 changed files with 37 additions and 32 deletions
+7 -4
View File
@@ -3,20 +3,23 @@ repos:
rev: 3.8.3 rev: 3.8.3
hooks: hooks:
- id: flake8 - id: flake8
pass_filenames: true
# this seems to need to be here in addition to setup.cfg
exclude: cibuildwheel/resources/ exclude: cibuildwheel/resources/
additional_dependencies: [flake8-bugbear]
- repo: https://github.com/pre-commit/pre-commit-hooks - repo: https://github.com/pre-commit/pre-commit-hooks
rev: v3.2.0 rev: v3.2.0
hooks: hooks:
- id: check-yaml - id: check-case-conflict
- id: check-merge-conflict - id: check-merge-conflict
- id: check-yaml
- id: end-of-file-fixer - id: end-of-file-fixer
exclude: cibuildwheel/resources/pinned_docker_images.cfg exclude: cibuildwheel/resources/pinned_docker_images.cfg
- id: mixed-line-ending
- id: trailing-whitespace
- repo: https://github.com/pre-commit/mirrors-mypy - repo: https://github.com/pre-commit/mirrors-mypy
rev: v0.782 rev: v0.782
hooks: hooks:
- id: mypy - id: mypy
files: cibuildwheel/|test/ files: cibuildwheel/|test/
entry: mypy
pass_filenames: false pass_filenames: false
+3 -2
View File
@@ -117,11 +117,12 @@ class DockerContainer:
return [PurePath(p) for p in path_strs] return [PurePath(p) for p in path_strs]
def call(self, args: Sequence[Union[str, PathLike]], env: Dict[str, str] = {}, def call(self, args: Sequence[Union[str, PathLike]], env: Optional[Dict[str, str]] = None,
capture_output=False, cwd: Optional[Union[str, PathLike]] = None) -> str: capture_output=False, cwd: Optional[Union[str, PathLike]] = None) -> str:
chdir = f'cd {cwd}' if cwd else '' chdir = f'cd {cwd}' if cwd else ''
env_assignments = ' '.join(f'{shlex.quote(k)}={shlex.quote(v)}' env_assignments = ' '.join(f'{shlex.quote(k)}={shlex.quote(v)}'
for k, v in env.items()) for k, v in env.items()) if env is not None else ''
command = ' '.join(shlex.quote(str(a)) for a in args) command = ' '.join(shlex.quote(str(a)) for a in args)
end_of_message = str(uuid.uuid4()) end_of_message = str(uuid.uuid4())
+2 -1
View File
@@ -1,5 +1,6 @@
[flake8] [flake8]
ignore = E501,W503,E741,E226 ignore = E501,W503,E741,E226,B950
select = C,E,F,W,B,B9
application-import-names = cibuildwheel application-import-names = cibuildwheel
exclude = exclude =
cibuildwheel/resources/, cibuildwheel/resources/,