mirror of
https://github.com/Hopiu/djLint.git
synced 2026-05-19 10:31:07 +00:00
fixed test for github
This commit is contained in:
parent
0111614913
commit
9a57551c7a
5 changed files with 26 additions and 1 deletions
|
|
@ -1,6 +1,14 @@
|
|||
Changelog
|
||||
=========
|
||||
|
||||
0.5.9
|
||||
-----
|
||||
- Added option ``--use-gitignore`` to extend the excludes
|
||||
- Changed default exclude matching
|
||||
- Fixed windows exclude paths
|
||||
- Fixed formatting of ``{%...%}`` tags in attributes
|
||||
- Fixed formatting for for loops and nested conditions in attributes
|
||||
|
||||
0.5.8
|
||||
-----
|
||||
- Added require_pragma option
|
||||
|
|
|
|||
|
|
@ -149,3 +149,14 @@ Usage:
|
|||
.. code:: ini
|
||||
|
||||
max_attribute_length=10
|
||||
|
||||
use_gitignore
|
||||
-------------
|
||||
|
||||
Add .gitignore excludes to the default exclude.
|
||||
|
||||
Usage:
|
||||
|
||||
.. code:: ini
|
||||
|
||||
use_gitignore = True
|
||||
|
|
|
|||
|
|
@ -117,4 +117,5 @@ CLI Args
|
|||
--require-pragma Only format or lint files that starts with a comment
|
||||
with the text 'djlint:on'
|
||||
--lint Lint for common issues. [default option]
|
||||
--use-gitignore Use .gitignore file to extend excludes.
|
||||
-h, --help Show this message and exit.
|
||||
|
|
|
|||
|
|
@ -87,7 +87,7 @@ from .src import get_src
|
|||
@click.option(
|
||||
"--use-gitignore",
|
||||
is_flag=True,
|
||||
help="Use .gitignore file as exclude. [default option]",
|
||||
help="Use .gitignore file to extend excludes.",
|
||||
)
|
||||
def main(
|
||||
src: List[str],
|
||||
|
|
|
|||
|
|
@ -13,6 +13,7 @@ for a single test, run::
|
|||
"""
|
||||
# pylint: disable=C0116
|
||||
import os
|
||||
from pathlib import Path
|
||||
|
||||
from click.testing import CliRunner
|
||||
|
||||
|
|
@ -23,6 +24,8 @@ def test_cli(runner: CliRunner) -> None:
|
|||
result = runner.invoke(djlint, ["tests/config_gitignore/html_two.html", "--check"])
|
||||
assert result.exit_code == 1
|
||||
|
||||
# create .git folder to make root
|
||||
Path("tests/config_gitignore/.git").mkdir(parents=True, exist_ok=True)
|
||||
# add a gitignore file
|
||||
with open("tests/config_gitignore/.gitignore", "w") as git:
|
||||
git.write("html_two.html")
|
||||
|
|
@ -43,6 +46,8 @@ def test_pyproject(runner: CliRunner) -> None:
|
|||
result = runner.invoke(djlint, ["tests/config_gitignore/html_two.html", "--check"])
|
||||
assert result.exit_code == 1
|
||||
|
||||
# make a root
|
||||
Path("tests/config_gitignore/.git").mkdir(parents=True, exist_ok=True)
|
||||
# add a gitignore file
|
||||
with open("tests/config_gitignore/.gitignore", "w") as git:
|
||||
git.write("html_two.html")
|
||||
|
|
|
|||
Loading…
Reference in a new issue