Skip to content

Commit

Permalink
Add configuration for just task runner. (#95)
Browse files Browse the repository at this point in the history
* Add configuration for just task runner.

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
domdfcoding and pre-commit-ci[bot] committed Apr 5, 2022
1 parent cadb59a commit 37cbe94
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 0 deletions.
17 changes: 17 additions & 0 deletions repo_helper/files/testing.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@
"make_isort",
"make_formate_toml",
"ensure_tests_requirements",
"make_justfile",
]

allowed_rst_directives = ["envvar", "TODO", "extras-require", "license", "license-info"]
Expand Down Expand Up @@ -948,3 +949,19 @@ def ensure_tests_requirements(repo_path: pathlib.Path, templates: Environment) -

TestsRequirementsManager(repo_path, templates).run()
return [(PathPlus(templates.globals["tests_dir"]) / "requirements.txt").as_posix()]


@management.register("justfile")
def make_justfile(repo_path: pathlib.Path, templates: Environment) -> List[str]:
"""
Add configuration for ``just``.
https://github.com/casey/just
:param repo_path: Path to the repository root.
:param templates:
"""

file = PathPlus(repo_path) / "justfile"
file.write_clean(templates.get_template("justfile.t").render())
return [file.name]
24 changes: 24 additions & 0 deletions repo_helper/templates/justfile.t
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
pdf-docs: latex-docs
make -C doc-source/build/latex/

latex-docs:
SPHINX_BUILDER=latex tox -e docs

unused-imports:
tox -e lint -- --select F401

incomplete-defs:
#!/usr/bin/env bash
tox -e mypy -- --disallow-incomplete-defs --disallow-untyped-defs | grep "Function is missing a .* annotation" || exit 0

vdiff:
git diff $(repo-helper show version -q)..HEAD
bare-ignore:
greppy '# type:? *ignore(?!\[|\w)' -s
lint: unused-imports incomplete-defs bare-ignore
tox -n qa
default: lint
true
1 change: 1 addition & 0 deletions tests/test_core_/test_via_Repo_class.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
- doc-source/requirements.txt
- formate.toml
- git_helper.yml
- justfile
- lint_roller.sh
- pyproject.toml
- repo_helper.yml
Expand Down
1 change: 1 addition & 0 deletions tests/test_core_/test_via_run_repo_helper.txt
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ The following files will be committed:
README.rst
__pkginfo__.py
formate.toml
justfile
pyproject.toml
repo_helper.yml
setup.cfg
Expand Down

0 comments on commit 37cbe94

Please sign in to comment.