Skip to main content

Static linter for git diffs generated by AI coding agents (Kimi, Aider, Copilot, Cursor, etc.)

Project description

aidiff-lint

Linter independiente (sin dependencias de terceros) para diffs de Git generados por agentes de codificacion IA (Kimi, Aider, Copilot, Cursor, etc.).

Detecta patrones de falla recurrentes que no son errores de sintaxis evidentes, pero rompen la compilacion, el renderizado, o introducen basura en la base de codigo:

  • Inyeccion de caracteres CJK en docstrings/comentarios.
  • Cadenas Django ORM alucinadas (Model.field.related_model.objects).
  • Tags de Django templates rotos o desbalanceados (incluyendo cierres eliminados por el propio diff, no solo agregados).
  • Tags HTML estructurales rotos o duplicados.
  • "Smells" de templates Django: URLs de admin hardcodeadas, target="_blank" sin rel="noopener noreferrer", formularios POST sin {% csrf_token %}.
  • Cadenas de atributos sospechosamente profundas a traves de objetos tipo diccionario (alert.metadata.batch.id) que fallan en silencio en templates Django.

Instalacion

pip install -e ".[dev]"

Uso

aidiff-lint                      # unstaged changes
aidiff-lint --staged             # staged changes
aidiff-lint --commit <hash>      # un commit especifico
aidiff-lint --range <a>..<b>     # un rango de commits
aidiff-lint --diff-file path.diff
aidiff-lint --repo /ruta/al/repo

Exit codes

  • 0: sin hallazgos ERROR (puede haber WARNING).
  • 1: al menos un hallazgo ERROR.
  • 2: error de uso/ejecucion.

Tests

pytest tests/ -v

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

aidiff_lint-0.1.0.tar.gz (16.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

aidiff_lint-0.1.0-py3-none-any.whl (12.1 kB view details)

Uploaded Python 3

File details

Details for the file aidiff_lint-0.1.0.tar.gz.

File metadata

  • Download URL: aidiff_lint-0.1.0.tar.gz
  • Upload date:
  • Size: 16.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.11.0

File hashes

Hashes for aidiff_lint-0.1.0.tar.gz
Algorithm Hash digest
SHA256 f75dee470716f6fa1161cefcd1ddebb7afa14bc7a1a44cb060ca7c62a5a357f8
MD5 aa65a39a0f6f49c8180c76436f67220d
BLAKE2b-256 ecd04d34af8cc9e7ed5fbe1aac0221b4aa75a35402c4efa090fe0c6dd179ed75

See more details on using hashes here.

File details

Details for the file aidiff_lint-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: aidiff_lint-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 12.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.11.0

File hashes

Hashes for aidiff_lint-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 caac4648c93b0ecd515dedbe220037b11d88afcc13488f6c8fc6005ae0ed377a
MD5 ebc7814616c74dde686ffb4a44e21676
BLAKE2b-256 6e8e1f265e9372f0cccc0fceb4940ce051d819883a1e986a47d8b6203fd2be52

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page