Skip to content

Commit 4d926ff

Browse files
committed
Linting.
1 parent a88182d commit 4d926ff

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

repo_helper/files/pre_commit.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -244,10 +244,12 @@ def make_pre_commit(repo_path: pathlib.Path, templates: jinja2.Environment) -> L
244244
}]
245245
)
246246

247+
yapf_isort_excludes = fr"^({'|'.join([*templates.globals['yapf_exclude'], *non_source_files])})\.py$"
248+
247249
yapf_isort = Repo(
248250
repo=make_github_url("domdfcoding", "yapf-isort"),
249251
rev="v0.4.4",
250-
hooks=[{"id": "yapf-isort", "exclude": fr"^({'|'.join(non_source_files)})\.py$"}]
252+
hooks=[{"id": "yapf-isort", "exclude": yapf_isort_excludes}],
251253
)
252254

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

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

263+
if not pre_commit_file.is_file():
264+
pre_commit_file.touch()
265+
261266
dumper = ruamel.yaml.YAML()
262267
dumper.indent(mapping=2, sequence=3, offset=1)
263268

tests/test_cli/test_conda_recipe_/test_conda_recipe.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ requirements:
2828
- lxml
2929
- packaging>=20.4
3030
- pre-commit>=2.7.1
31-
- ruamel_yaml>=0.16.12
31+
- ruamel.yaml>=0.16.12
3232
- tomlkit>=0.7.0
3333
- typing-extensions>=3.7.4.3
3434
run:
@@ -44,7 +44,7 @@ requirements:
4444
- lxml
4545
- packaging>=20.4
4646
- pre-commit>=2.7.1
47-
- ruamel_yaml>=0.16.12
47+
- ruamel.yaml>=0.16.12
4848
- tomlkit>=0.7.0
4949
- typing-extensions>=3.7.4.3
5050

0 commit comments

Comments
 (0)