linting-and-formatting

Enforce Python and shell script style rules with ruff, isort, and pre-commit.

852|445|Updated May 21, 2025
One-click install
npx skills add https://github.com/NVIDIA-NeMo/Megatron-Bridge --skill linting-and-formatting
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: linting-and-formatting
Source: https://github.com/NVIDIA-NeMo/Megatron-Bridge/tree/main/skills/linting-and-formatting
Command: npx skills add https://github.com/NVIDIA-NeMo/Megatron-Bridge --skill linting-and-formatting

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires ruff, isort, pre-commit, and includes scripts (resource) and references (resource) components.

What problem does it solve?

It enforces uniform coding standards and best practices to improve code readability, maintainability, and team collaboration.

Core Features & Use Cases

  • Style Enforcement: Implements and checks adherence to Python and shell style guides.
  • Automated Formatting: Formats code and fixes style issues automatically before commits.
  • Use Case: A team integrates this Skill within their CI/CD pipeline to automatically verify and enforce code consistency for every pull request.

Quick Start

Use the linting and formatting skill to check your codebase for style issues and fix automatically.

Frequently Asked Questions about linting-and-formatting

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I enforce Python code style and formatting automatically before commits?

You can enforce Python code style by integrating pre-commit hooks with ruff and isort to automatically validate and format scripts before they are committed. This ensures consistent adherence to style guides across your codebase.

How does static analysis with ruff compare to other linting tools for large codebases?

Static analysis with ruff checks adherence to Python style guides and validates code quality rules. It serves as a fast, automated enforcement mechanism suitable for teams maintaining large codebases and ensuring compliance with coding standards.

Can I use pre-commit hooks to check shell script quality in a CI/CD pipeline?

Yes, pre-commit hooks can validate shell script quality and enforce style guides within your CI/CD pipeline. This automated verification checks code consistency for every pull request across both Python and shell scripts.

Do I need isort and ruff to automatically fix code style issues in my repository?

Yes, isort and ruff are required dependencies to automatically format code and fix style issues. They provide the automated enforcement needed to validate and format code effectively across your development workflows.

What is the best way to maintain consistent code quality across a large development team?

The best way to maintain consistent code quality is implementing automated style enforcement using pre-commit hooks. This integrates directly into development workflows to automatically verify and enforce coding standards for every contribution.

When should I not use automated code formatting in my development workflow?

You should avoid automated code formatting when your project requires highly customized, non-standard style configurations that conflict with established Python and shell style guides. The tool enforces uniform standards that may not fit specialized formatting needs.