Skip to content

Lint rules

djangofmt's built-in lint rules, grouped by category. Each rule has a stable kebab-case name; click through for the rule's documentation, examples, and source location.

Correctness

Name Message Fix
invalid-attr-value Invalid value '{}' for attribute '{}'. None
untrimmed-blocktranslate {% blocktranslate %} should declare trimmed to avoid leaking indentation into translation strings. Always

Suspicious

Name Message Fix
django-static-url Hardcoded static path in {}. None
django-url-pattern Hardcoded internal URL in {}. None
javascript-url Avoid javascript: URLs in {}. None
duplicate-attr Duplicate attribute {}. None
use-https Avoid http:// URLs in {}. Always
empty-tag-pair Empty <{}> tag pair. None

Style

Name Message Fix
empty-attr-value Empty {} attribute can be removed. Always
redundant-type-attr Redundant type="{}" on <{}> tag. Always
uppercase-form-method Form method {} should be lowercase. Always
form-action-whitespace Extra whitespace found in form action. Always
missing-doctype Missing <!DOCTYPE html> declaration. None

Accessibility

Name Message Fix
missing-html-lang <html> tag should declare a lang attribute. None
missing-title Missing or empty <title> in <head>. None
missing-img-alt <img> tag should declare an alt attribute. None
missing-img-dimensions <img> tag should declare both height and width attributes. None