mirror of
https://github.com/Hopiu/djLint.git
synced 2026-04-28 08:54:45 +00:00
Merge branch 'master' of github.com:Riverside-Healthcare/djlint
This commit is contained in:
commit
b9d1fe5e7a
3 changed files with 9 additions and 1 deletions
|
|
@ -62,3 +62,4 @@ CLI Args
|
|||
--check Check formatting on the file(s).
|
||||
--quiet Do not print diff when reformatting.
|
||||
-h, --help Show this message and exit.
|
||||
--version Get djLint version
|
||||
|
|
|
|||
|
|
@ -151,6 +151,7 @@ def build_quantity_tense(size: int) -> str:
|
|||
nargs=1,
|
||||
metavar="SRC ...",
|
||||
)
|
||||
@click.version_option(package_name="djlint")
|
||||
@click.option(
|
||||
"-e",
|
||||
"--extension",
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ run::
|
|||
|
||||
for a single test::
|
||||
|
||||
pytest tests/test_djlint.py::test_W010 --cov=src/djlint \
|
||||
pytest tests/test_djlint.py::test_version --cov=src/djlint \
|
||||
--cov-branch --cov-report xml:coverage.xml --cov-report term-missing
|
||||
|
||||
or::
|
||||
|
|
@ -19,6 +19,7 @@ or::
|
|||
from pathlib import Path
|
||||
from typing import TextIO
|
||||
|
||||
import pkg_resources
|
||||
from click.testing import CliRunner
|
||||
|
||||
from src.djlint import main as djlint
|
||||
|
|
@ -136,3 +137,8 @@ def test_check_reformatter_no_error(runner: CliRunner, tmp_file: TextIO) -> None
|
|||
result = runner.invoke(djlint, [tmp_file.name, "--check"])
|
||||
assert result.exit_code == 0
|
||||
assert "0 files would be updated." in result.output
|
||||
|
||||
|
||||
def test_version(runner: CliRunner) -> None:
|
||||
result = runner.invoke(djlint, ["--version"])
|
||||
assert pkg_resources.get_distribution("djlint").version in result.output
|
||||
|
|
|
|||
Loading…
Reference in a new issue