Skip to main content

Automated code formatting and linting for GitHub and GitLab.

Project description

janitor-sh CLI 🧹

The core Rust-based engine for the janitor-sh organization. This CLI provides high-performance, automated code formatting and linting orchestration across CI/CD environments.

Documentation: https://docs.janitor.sh/

Features

  • Multi-Platform Detection: Automatically identifies if it's running in GitHub Actions, GitLab CI, or another shell environment.
  • Smart Orchestration: Invokes industry-standard tools based on the project structure:
    • Ruff: For lightning-fast Python linting and formatting.
    • Biome: For high-performance JavaScript/TypeScript orchestration.
    • rumdl: For consistent formatting of Markdown and documentation files.
    • Clippy & Cargo Fmt: For maintaining Rust code quality.
  • Automated Fixes: Designed to automatically apply and commit fixes to minimize developer overhead.

Installation

Install with uv:

uv tool install janitor-sh

Usage

Run the janitor CLI from the root of any supported repository:

janitor

The tool will automatically detect your environment and run the appropriate suite of formatters and linters.

Commit Mode Flags

  • --auto-commit: force creation of an automated conventional commit when janitor applies fixes.
  • --no-commit: force janitor to skip commit creation.
  • default behavior:
    • in CI (GitHub Actions and GitLab CI): auto-commit enabled.
    • outside CI: no auto-commit.

You can also scope execution to a single tool:

janitor --tool ruff

Development

Running Tests

We maintain high standards for correctness and platform compatibility.

cargo test

Linting & Formatting

Ensure your contributions follow our style guidelines:

cargo clippy -- -D warnings
cargo fmt -- --check

Release Runbook

One-time repository setup:

  • Create GitHub environment pypi (recommended: protect with tag-only deploy rules).
  • Configure a PyPI Trusted Publisher for this repository/workflow/environment.
  • Set Cloudflare deployment settings:
    • secret: CLOUDFLARE_API_TOKEN
    • secret: CLOUDFLARE_ACCOUNT_ID
    • variable: CLOUDFLARE_PAGES_PROJECT
  1. Update version in /Users/drew.simmons/developer/github/personal/janitor-sh/cli/pyproject.toml.
  2. Update /Users/drew.simmons/developer/github/personal/janitor-sh/cli/CHANGELOG.md.
  3. Update /Users/drew.simmons/developer/github/personal/janitor-sh/cli/docs/src/pages/docs/release-notes.md.
  4. Merge to main and create a GitHub Release tag in the form vX.Y.Z.
  5. Monitor these workflows:
    • /Users/drew.simmons/developer/github/personal/janitor-sh/.github/workflows/cli-release.yml
    • /Users/drew.simmons/developer/github/personal/janitor-sh/.github/workflows/cli-docs-pages.yml
  6. Verify successful publication on PyPI and docs deployment on Cloudflare Pages.

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

janitor_sh-0.1.1.tar.gz (1.2 MB view details)

Uploaded Source

Built Distribution

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

janitor_sh-0.1.1-py3-none-manylinux_2_39_x86_64.whl (240.2 kB view details)

Uploaded Python 3manylinux: glibc 2.39+ x86-64

File details

Details for the file janitor_sh-0.1.1.tar.gz.

File metadata

  • Download URL: janitor_sh-0.1.1.tar.gz
  • Upload date:
  • Size: 1.2 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for janitor_sh-0.1.1.tar.gz
Algorithm Hash digest
SHA256 2c3e610b934f37b1cc50eef9974de8e61187b59263c4bcef7482f284f39e986c
MD5 15df0e7f5e96787e4c13fbbb71af85ab
BLAKE2b-256 4a76b30d73e8dd4b90d3ad50a22099cae8633680caf229dbc6a1e45e90200a75

See more details on using hashes here.

Provenance

The following attestation bundles were made for janitor_sh-0.1.1.tar.gz:

Publisher: release.yml on janitor-sh/cli

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file janitor_sh-0.1.1-py3-none-manylinux_2_39_x86_64.whl.

File metadata

File hashes

Hashes for janitor_sh-0.1.1-py3-none-manylinux_2_39_x86_64.whl
Algorithm Hash digest
SHA256 5e475fa485dd306d4b8eb9fefce34cf0aeb746aa601495d7b0d18ac5708ae43f
MD5 a6e17e492a03c87970616afec0699fd2
BLAKE2b-256 54c51d67abc33e55430c20981d2120c5bd8efe9389d6ed58044f7c7afdf831c1

See more details on using hashes here.

Provenance

The following attestation bundles were made for janitor_sh-0.1.1-py3-none-manylinux_2_39_x86_64.whl:

Publisher: release.yml on janitor-sh/cli

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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