Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] [Linter] H026 triggering inside quoted text when using keyword class #829

Open
jpdborgna opened this issue Apr 13, 2024 · 0 comments
Labels
🔍 linter 🦠 bug Something isn't working

Comments

@jpdborgna
Copy link

jpdborgna commented Apr 13, 2024

How To Reproduce

I'm using the "class" word inside my content, which I want to use, and it's triggering the linter.
My line:

<meta name="description" content="Simple app to rate quality of a service, a class, a session, a workout, etc." />

Contents of .djlintrc/pyproject.toml [tool.djlint]

# ==== pytest ====
[tool.pytest.ini_options]
minversion = "6.0"
addopts = "--ds=config.settings.test --reuse-db --import-mode=importlib"
python_files = [
    "tests.py",
    "test_*.py",
]
norecursedirs = ["node_modules"]

# ==== Coverage ====
[tool.coverage.run]
include = ["rankofme/**"]
omit = ["*/migrations/*", "*/tests/*"]
plugins = ["django_coverage_plugin"]

# ==== mypy ====
[tool.mypy]
python_version = "3.12"
check_untyped_defs = true
ignore_missing_imports = true
warn_unused_ignores = true
warn_redundant_casts = true
warn_unused_configs = true
plugins = [
    "mypy_django_plugin.main",
    "mypy_drf_plugin.main",
]

[[tool.mypy.overrides]]
# Django migrations should not produce any errors:
module = "*.migrations.*"
ignore_errors = true

[tool.django-stubs]
django_settings_module = "config.settings.test"

# ==== djLint ====
[tool.djlint]
blank_line_after_tag = "load,extends"
close_void_tags = true
format_css = true
format_js = true
# TODO: remove T002 when fixed https://github.com/Riverside-Healthcare/djLint/issues/687
ignore = "H006,H030,H031,T002"
include = "H017,H035"
indent = 2
max_line_length = 119
profile = "django"

[tool.djlint.css]
indent_size = 2

[tool.djlint.js]
indent_size = 2

[tool.ruff]
# Exclude a variety of commonly ignored directories.
exclude = [
    ".bzr",
    ".direnv",
    ".eggs",
    ".git",
    ".git-rewrite",
    ".hg",
    ".mypy_cache",
    ".nox",
    ".pants.d",
    ".pytype",
    ".ruff_cache",
    ".svn",
    ".tox",
    ".venv",
    "__pypackages__",
    "_build",
    "buck-out",
    "build",
    "dist",
    "node_modules",
    "venv",
    "*/migrations/*.py",
    "staticfiles/*"
]
# Same as Django: https://github.com/cookiecutter/cookiecutter-django/issues/4792.
line-length = 88
indent-width = 4
target-version = "py312"

[tool.ruff.lint]
select = [
  "F",
  "E",
  "W",
  "C90",
  "I",
  "N",
  "UP",
  "YTT",
  # "ANN", # flake8-annotations: we should support this in the future but 100+ errors atm
  "ASYNC",
  "S",
  "BLE",
  "FBT",
  "B",
  "A",
  "COM",
  "C4",
  "DTZ",
  "T10",
  "DJ",
  "EM",
  "EXE",
  "FA",
  'ISC',
  "ICN",
  "G",
  'INP',
  'PIE',
  "T20",
  'PYI',
  'PT',
  "Q",
  "RSE",
  "RET",
  "SLF",
  "SLOT",
  "SIM",
  "TID",
  "TCH",
  "INT",
  # "ARG", # Unused function argument
  "PTH",
  "ERA",
  "PD",
  "PGH",
  "PL",
  "TRY",
  "FLY",
  # "NPY",
  # "AIR",
  "PERF",
  # "FURB",
  # "LOG",
  "RUF"
]
ignore = [
  "S101", # Use of assert detected https://docs.astral.sh/ruff/rules/assert/
  "RUF012", # Mutable class attributes should be annotated with `typing.ClassVar`
  "SIM102" # sometimes it's better to nest
]
# Allow fix for all enabled rules (when `--fix`) is provided.
fixable = ["ALL"]
unfixable = []
# Allow unused variables when underscore-prefixed.
dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$"

[tool.ruff.format]
quote-style = "double"
indent-style = "space"
skip-magic-trailing-comma = false
line-ending = "auto"

[tool.ruff.lint.isort]
force-single-line = true
@jpdborgna jpdborgna added 🔍 linter 🦠 bug Something isn't working labels Apr 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🔍 linter 🦠 bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant