Skip to content

Commit

Permalink
Linting.
Browse files Browse the repository at this point in the history
  • Loading branch information
domdfcoding committed Nov 11, 2020
1 parent a88182d commit 4d926ff
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
7 changes: 6 additions & 1 deletion repo_helper/files/pre_commit.py
Original file line number Diff line number Diff line change
Expand Up @@ -244,10 +244,12 @@ def make_pre_commit(repo_path: pathlib.Path, templates: jinja2.Environment) -> L
}]
)

yapf_isort_excludes = fr"^({'|'.join([*templates.globals['yapf_exclude'], *non_source_files])})\.py$"

yapf_isort = Repo(
repo=make_github_url("domdfcoding", "yapf-isort"),
rev="v0.4.4",
hooks=[{"id": "yapf-isort", "exclude": fr"^({'|'.join(non_source_files)})\.py$"}]
hooks=[{"id": "yapf-isort", "exclude": yapf_isort_excludes}],
)

dep_checker = Repo(
Expand All @@ -258,6 +260,9 @@ def make_pre_commit(repo_path: pathlib.Path, templates: jinja2.Environment) -> L

pre_commit_file = PathPlus(repo_path / ".pre-commit-config.yaml")

if not pre_commit_file.is_file():
pre_commit_file.touch()

dumper = ruamel.yaml.YAML()
dumper.indent(mapping=2, sequence=3, offset=1)

Expand Down
4 changes: 2 additions & 2 deletions tests/test_cli/test_conda_recipe_/test_conda_recipe.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ requirements:
- lxml
- packaging>=20.4
- pre-commit>=2.7.1
- ruamel_yaml>=0.16.12
- ruamel.yaml>=0.16.12
- tomlkit>=0.7.0
- typing-extensions>=3.7.4.3
run:
Expand All @@ -44,7 +44,7 @@ requirements:
- lxml
- packaging>=20.4
- pre-commit>=2.7.1
- ruamel_yaml>=0.16.12
- ruamel.yaml>=0.16.12
- tomlkit>=0.7.0
- typing-extensions>=3.7.4.3

Expand Down

0 comments on commit 4d926ff

Please sign in to comment.