Skip to main content

repository-hygiene

Repository hygiene auditor for Git repositories. Checks for secrets, broken links, missing references, artifacts outside .gitignore, GitHub Actions workflow security, and more.

Installation

pip install repository-hygiene

Usage

Audit a repository

repository-hygiene audit .                    # text (default)
repository-hygiene audit . --format json      # JSON
repository-hygiene audit . --format sarif     # SARIF
repository-hygiene audit --config path/to/auditoria.yaml .

Initialize a project

repository-hygiene install .                  # creates auditoria.yaml + workflow
repository-hygiene install --force .          # overwrites existing files

Update

repository-hygiene update                     # check for updates
repository-hygiene update --version 0.1.0     # update to specific version

Exit codes

Code Meaning
0 Clean audit (no errors)
1 Error(s) found
2 Invalid configuration or execution

Configuration

File auditoria.yaml in the project root:

versao_configuracao: 1

regras:
  segredos_rastreados:
    habilitada: true
    severidade: error
  links_internos_quebrados:
    habilitada: true
    severidade: error
  referencias_inexistentes:
    habilitada: true
    severidade: error
  artefatos_fora_gitignore:
    habilitada: true
    severidade: error
  gitkeep_sem_conteudo:
    habilitada: true
    severidade: warning
  arquivos_sem_referencia:
    habilitada: true
    severidade: warning
  documentacao_desatualizada:
    habilitada: true
    severidade: warning
  configuracao_sem_integracao:
    habilitada: true
    severidade: warning
  openspec_parada:
    habilitada: true
    severidade: warning
  workflows_inseguros:
    habilitada: true
    severidade: warning

excecoes:
  segredos_rastreados:
    - .secrets.baseline
    - .env.example
  referencias_inexistentes:
    - audit-report.txt
  artefatos_fora_gitignore:
    - .git
  arquivos_sem_referencia:
    - .gitignore
    - Makefile

Rules

Rule Default severity Description
segredos_rastreados error Detects passwords, tokens, and credentials in tracked files
links_internos_quebrados error Markdown links to non-existent files
referencias_inexistentes error References to files that don't exist in the repository
artefatos_fora_gitignore error Generated files not covered by .gitignore
gitkeep_sem_conteudo warning Directories with only .gitkeep
arquivos_sem_referencia warning Files not mentioned anywhere else
documentacao_desatualizada warning Documentation referencing non-existent files
configuracao_sem_integracao warning Config without workflow, command, or docs
openspec_parada warning OpenSpec changes stalled for 30+ days
workflows_inseguros warning Excessive permissions, actions without fixed version

GitHub Actions

The install command generates a caller workflow in .github/workflows/repository-hygiene.yml that:

  • Runs weekly and on push/PR in relevant paths
  • Calls the reusable workflow from frederico-mello/repository-hygiene at a fixed version
  • Publishes report in the execution summary
  • Creates/updates a consolidated issue when errors are found
  • Closes the issue when the audit is clean

Minimum workflow permissions

permissions:
  contents: read
  issues: write
  pull-requests: read

Versioning

The package follows SemVer. Configuration declares versao_configuracao for future compatibility.

  • v0.1.x — initial version
  • Workflow tags follow package tags

Development

pip install -e .
pytest tests_package/

License

MIT

Metadata

Release files for repository-hygiene 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for repository-hygiene 0.1.0
File Size Uploaded
repository_hygiene-0.1.0.tar.gz 13.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for repository-hygiene 0.1.0
File Interpreter ABI Platform
repository_hygiene-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 28.5 kB

Release files / repository_hygiene-0.1.0.tar.gz

Download URL repository_hygiene-0.1.0.tar.gz
Size 13.5 kB
Tags Source
SHA-256 checksum
How to use checksums
30d39de565b70697c73b2fe3f149c56aec77d5d2c4ffc764ed7714654061b65c
BLAKE2b-256 checksum
How to use checksums
7e8de99c36faeb8c512a36937376e8d15594df3e2dd7e129d7019f08a3d42039
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.3

Release files / repository_hygiene-0.1.0-py3-none-any.whl

Download URL repository_hygiene-0.1.0-py3-none-any.whl
Size 15.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ceef608ed9a96d85d6f5dc869f593434c93b83675fbd3a6d3a9529a8dd4e385e
BLAKE2b-256 checksum
How to use checksums
293d4209f7363b3ba4f89b3e52aeb8fbf4e9bda79ced6b94a2e76b2bbf66981f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.3

Release history Release notifications | RSS feed

1.1.1

2 release files

1.1.0

2 release files

1.0.0

2 release files

0.2.0

2 release files

This release

0.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page