Metadata-Version: 2.4
Name: django-no-multiline-template-comment
Version: 0.0.2
Summary: Reject multi-line Django '{# #}' template comments (a wrapped '{# #}' renders as visible text).
Author-email: Pierre Sassoulas <pierre.sassoulas@gmail.com>
Project-URL: Homepage, https://github.com/Pierre-Sassoulas/django-no-multiline-template-comment/
Classifier: Operating System :: OS Independent
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Programming Language :: Python :: 3.15
Classifier: Development Status :: 5 - Production/Stable
Classifier: Framework :: Django
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Provides-Extra: test
Requires-Dist: pytest-cov; extra == "test"
Requires-Dist: pytest-remaster; extra == "test"
Requires-Dist: coverage; extra == "test"
Requires-Dist: coveralls; extra == "test"
Requires-Dist: pylint; extra == "test"
Requires-Dist: pre-commit; extra == "test"
Requires-Dist: tbump; extra == "test"
Requires-Dist: setuptools; extra == "test"
Dynamic: license-file

# django-no-multiline-template-comment

[![PyPI version](https://badge.fury.io/py/django-no-multiline-template-comment.svg)](https://badge.fury.io/py/django-no-multiline-template-comment)
[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square)](http://makeapullrequest.com)

`django-no-multiline-template-comment` rejects multi-line Django `{# … #}` template
comments.

## Why

Django's `{# #}` comment is **single-line only**. A `{#` whose closing `#}` is on a
later line does **not** comment the following lines — they render as visible text on the
page. Use `{% comment %}…{% endcomment %}` for anything that may wrap. This hook catches
the mistake in CI.

```jinja
{# ✗ broken: this comment
   spans two lines, so everything here leaks onto the page as text #}

{# ✓ fixed: single-line comment #}
{% comment %}
   ...or {% comment %} for anything that may wrap.
{% endcomment %}
```

## Installation

```yaml
- repo: https://github.com/Pierre-Sassoulas/django-no-multiline-template-comment/
  rev: v0.0.2
  hooks:
    - id: django-no-multiline-template-comment
```

## Autofix

Pass `--fix` to rewrite offending comments to `{% comment %}…{% endcomment %}` in place
(valid single-line comments and unterminated `{#` are left untouched). As with other
fixer hooks, a rewritten file fails the run so you review and re-stage it.

```yaml
- repo: https://github.com/Pierre-Sassoulas/django-no-multiline-template-comment/
  rev: v0.0.2
  hooks:
    - id: django-no-multiline-template-comment
      args: [--fix]
```
