Skip to content
Back to skills

180 Pants Format Check Ceae4811

ASecurity

Runs pants formatting, linting, and type checking on Python code, fixing issues automatically. Use when finishing implementation, before committing code, or when the user asks to format, lint, or check code quality.

  • 9 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added October 11, 2026
documentationpythonbash

Security analysis

A100/100

Pro scans all 2 files and shows the line behind each finding

Scanned October 11, 2026

npx -y skills add tools-only/X-Skills --skill 180-pants-format-check_ceae4811 --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of 180 Pants Format Check Ceae4811?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for 180 Pants Format Check Ceae4811
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/tools-only-180-pants-format-check-ceae4811/badge)](https://www.skillsdirectory.com/skills/tools-only-180-pants-format-check-ceae4811)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: pants-format-check
description: Runs pants formatting, linting, and type checking on Python code, fixing issues automatically. Use when finishing implementation, before committing code, or when the user asks to format, lint, or check code quality.
---

# Pants Format and Lint Check

## When to Use

Apply this skill automatically when:
- Finishing implementation of a feature or fix
- User asks to format, lint, or check code
- Before committing changes
- After modifying Python files

## Workflow

Follow these steps in order:

### Step 1: Remove Unused Imports

Remove unused imports first to prevent common linting errors:

```bash
pants --changed-since=HEAD fix ::
```

This fixes import issues automatically before running full checks.

### Step 2: Run Full Format, Lint, and Check

Run the complete pants check suite:

```bash
pants fmt lint check ::
```

This command:
- **fmt**: Auto-formats code (isort, black, etc.)
- **lint**: Runs linters (flake8, pylint, etc.)
- **check**: Runs type checking (mypy)

### Step 3: Review and Fix Remaining Issues

If errors remain after Step 2:

1. **Read the error output** - pants provides specific file locations and line numbers
2. **Fix the issues** - address each error reported
3. **Re-run**: `pants fmt lint check ::`
4. **Repeat** until all checks pass

## Common Issues and Solutions

### Import Errors
If you see "unused import" or "import not found":
- Remove unused imports
- Add missing dependencies to BUILD files
- Check import paths are correct

### Type Errors
If mypy reports type issues:
- Add type hints where missing
- Fix incorrect type annotations
- Use `# type: ignore` comments only as a last resort

### Style Errors
If flake8/pylint reports style issues:
- Most are auto-fixed by `pants fmt`
- For manual fixes, follow the error message guidance
- Check `.flake8` and `.isort.cfg` for project conventions

## Success Criteria

✅ All checks pass with no errors
✅ No warnings that need attention
✅ Code is properly formatted and typed

## Notes

- Run this from the repository root (where `pants.toml` is located)
- The `::` selector checks all targets in the repo
- For faster checks on specific files, use: `pants fmt lint check path/to/file.py`
- Always run before creating commits to catch issues early

Files in this skill

  • README.md962 B
  • skill.md2.2 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…