mirror of
https://github.com/Hopiu/djLint.git
synced 2026-04-23 14:34:45 +00:00
Merge branch 'dev' into renovate/linters
This commit is contained in:
commit
7908f5544c
6 changed files with 697 additions and 1168 deletions
1819
docs/package-lock.json
generated
1819
docs/package-lock.json
generated
File diff suppressed because it is too large
Load diff
|
|
@ -25,7 +25,7 @@
|
|||
"md5": "^2.3.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@11ty/eleventy": "1.0.0",
|
||||
"@11ty/eleventy": "1.0.1",
|
||||
"@11ty/eleventy-img": "2.0.0",
|
||||
"@11ty/eleventy-plugin-syntaxhighlight": "4.0.0",
|
||||
"@fontsource/inter": "4.5.7",
|
||||
|
|
@ -33,14 +33,14 @@
|
|||
"@fullhuman/postcss-purgecss": "4.1.3",
|
||||
"@toycode/markdown-it-class": "1.2.4",
|
||||
"algoliasearch": "4.13.0",
|
||||
"autoprefixer": "10.4.4",
|
||||
"autoprefixer": "10.4.5",
|
||||
"bulma": "0.9.3",
|
||||
"bulma-pricingtable": "0.2.0",
|
||||
"cssnano": "5.1.7",
|
||||
"cz-conventional-changelog": "3.3.0",
|
||||
"eleventy-plugin-metagen": "1.6.1",
|
||||
"esbuild": "0.14.36",
|
||||
"eslint": "8.14.0",
|
||||
"esbuild": "0.14.38",
|
||||
"eslint-config-airbnb-base": "15.0.0",
|
||||
"eslint-plugin-import": "2.26.0",
|
||||
"fontawesome-subset": "3.0.0",
|
||||
|
|
@ -54,7 +54,7 @@
|
|||
"postcss-nested": "5.0.6",
|
||||
"prettier": "2.6.2",
|
||||
"prismjs": "1.28.0",
|
||||
"sass": "1.50.0",
|
||||
"sass": "1.50.1",
|
||||
"slugify": "1.6.5"
|
||||
},
|
||||
"config": {
|
||||
|
|
|
|||
|
|
@ -39,7 +39,7 @@
|
|||
},
|
||||
"scripts": {
|
||||
"postinstall": "node ./bin/install.js",
|
||||
"commit": "git add . && cz"
|
||||
"commit": "git add . && pre-commit run && git add . && cz --no-verify"
|
||||
},
|
||||
"author": {
|
||||
"name": "Christopher Pickering",
|
||||
|
|
|
|||
|
|
@ -1,15 +1,15 @@
|
|||
black==22.3.0; python_full_version >= "3.6.2"
|
||||
click==8.1.2; python_version >= "3.6"
|
||||
black==22.1.0; python_full_version >= "3.6.2"
|
||||
click==8.0.3; python_version >= "3.6"
|
||||
colorama==0.4.4; (python_version >= "2.7" and python_full_version < "3.0.0") or (python_full_version >= "3.5.0")
|
||||
importlib-metadata==4.11.3; python_version >= "3.7"
|
||||
importlib-metadata==4.11.0; python_version >= "3.7"
|
||||
isort==5.10.1; python_full_version >= "3.6.1" and python_version < "4.0"
|
||||
mypy-extensions==0.4.3; python_full_version >= "3.6.2"
|
||||
pathspec==0.9.0; (python_version >= "2.7" and python_full_version < "3.0.0") or (python_full_version >= "3.5.0")
|
||||
platformdirs==2.5.2; python_version >= "3.7" and python_full_version >= "3.6.2"
|
||||
platformdirs==2.5.0; python_version >= "3.7" and python_full_version >= "3.6.2"
|
||||
pyyaml==6.0; python_version >= "3.6"
|
||||
regex==2022.3.15
|
||||
regex==2022.4.24
|
||||
tomli==2.0.1; python_version >= "3.7" and python_full_version >= "3.6.2"
|
||||
tomlkit==0.10.1; python_version >= "3.6" and python_version < "4.0"
|
||||
tomlkit==0.10.2; python_version >= "3.6" and python_version < "4.0"
|
||||
tqdm==4.64.0; (python_version >= "2.7" and python_full_version < "3.0.0") or (python_full_version >= "3.4.0")
|
||||
typed-ast==1.5.3; python_version < "3.8" and implementation_name == "cpython" and python_full_version >= "3.6.2"
|
||||
typing-extensions==4.2.0; python_version < "3.8" and python_version >= "3.7" and python_full_version >= "3.6.2"
|
||||
|
|
|
|||
|
|
@ -135,6 +135,9 @@ def main(
|
|||
temp_file.write(str.encode(stdin_text))
|
||||
temp_file.seek(0)
|
||||
|
||||
# cannot use gitignore for stdin paths.
|
||||
config.use_gitignore = False
|
||||
|
||||
file_list = get_src([Path(temp_file.name)], config)
|
||||
|
||||
else:
|
||||
|
|
|
|||
|
|
@ -7,12 +7,13 @@ run::
|
|||
|
||||
for a single test, run::
|
||||
|
||||
pytest tests/test_config_gitignore.py::test_pyproject --cov=src/djlint \
|
||||
pytest tests/test_config_gitignore.py::test_ignored_path --cov=src/djlint \
|
||||
--cov-branch --cov-report xml:coverage.xml --cov-report term-missing
|
||||
|
||||
"""
|
||||
# pylint: disable=C0116
|
||||
import os
|
||||
import shutil
|
||||
from pathlib import Path
|
||||
|
||||
from click.testing import CliRunner
|
||||
|
|
@ -40,6 +41,7 @@ def test_cli(runner: CliRunner) -> None:
|
|||
assert result.exit_code == 1
|
||||
|
||||
os.remove("tests/config_gitignore/.gitignore")
|
||||
shutil.rmtree("tests/config_gitignore/.git")
|
||||
|
||||
|
||||
def test_pyproject(runner: CliRunner) -> None:
|
||||
|
|
@ -73,3 +75,20 @@ def test_pyproject(runner: CliRunner) -> None:
|
|||
|
||||
os.remove("tests/config_gitignore/.gitignore")
|
||||
os.remove("tests/config_gitignore/pyproject.toml")
|
||||
shutil.rmtree("tests/config_gitignore/.git")
|
||||
|
||||
def test_ignored_path(runner: CliRunner) -> None:
|
||||
# test for https://github.com/Riverside-Healthcare/djLint/issues/224
|
||||
# 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("var")
|
||||
|
||||
result = runner.invoke(djlint, ["-", "--use-gitignore"], input='<div><p id="a"></p></div>')
|
||||
print(result.output)
|
||||
assert result.exit_code == 0
|
||||
assert "Linted 1 file" in result.output
|
||||
|
||||
os.remove("tests/config_gitignore/.gitignore")
|
||||
shutil.rmtree("tests/config_gitignore/.git")
|
||||
|
|
|
|||
Loading…
Reference in a new issue