lint
Run targeted linting, formatting, and code quality checks on modified files. Use this to validate code style, type safety, security, and other quality metrics before committing. Supports running all checks or targeting specific checks on specific files for efficient validation.
Security Assessment
About lint
The `lint` skill provides an integrated framework for validating, formatting, and ensuring the quality of code before committing changes. It addresses common problems in software development such as inconsistent code style, type errors, security vulnerabilities, and documentation issues. By offering targeted linting and formatting capabilities, it enables developers to maintain high-quality code standards across a codebase, reducing the likelihood of bugs, runtime errors, and style inconsistencies that can arise when multiple contributors work on the same project.
This skill includes a comprehensive set of features for code quality assurance. It supports formatting code using Ruff, validating style compliance, performing type checks with mypy, and auditing code for security issues with Bandit. Users can run full checks across the codebase or target specific files or directories for more efficient validation. Additional capabilities include formatting snapshot test files, checking spelling and documentation, and verifying test infrastructure. The skill emphasizes automated fixes for style issues and selective type checking after adding type annotations, making it a versatile tool for maintaining consistent coding practices.
The `lint` skill is ideal for developers who want to ensure their code meets project standards before committing or pushing changes. Typical use cases include formatting newly edited files, validating code style and type hints, auditing security-sensitive code, and checking documentation or test artifacts. It is particularly useful in collaborative environments where multiple contributors must adhere to consistent style and quality guidelines, as well as in projects where automated checks are part of the continuous integration workflow. Target users include Python developers, quality assurance engineers, and teams aiming to streamline code review and enforce project-wide coding standards.
FAQ
How do I run linting on a specific file?
You can target a specific file by using the `-- <file>` syntax with the desired lint script. For example, `hatch run lint:fmt -- path/to/file.py` formats and validates that particular file.
Which programming languages and tools does this skill support?
The skill primarily supports Python code, using tools like Ruff for formatting and linting, mypy for type checking, and Bandit for security auditing. It also integrates with Bash, Grep, Glob, and basic file read/write operations.
Can lint automatically fix style issues?
Yes, using the `fmt` script will automatically fix style issues where possible. Other scripts like `style` and `format_check` perform validations without auto-fixing.
When should I run type checks?
Type checks should be run after adding or modifying type annotations, using `hatch run lint:typing -- <file>` for specific files or `hatch run lint:typing` for the entire codebase.
Are there security checks included?
Yes, the `security` script scans code for common security vulnerabilities using Bandit, which is recommended before committing code that handles sensitive data or user inputs.
Install lint
Quick Setup:
- Copy the skill folder to
.claude/skills/ - Claude will automatically detect and use the skill
Repository
Microck/ordinary-claude-skills