# Prylint

A blazing-fast Python linter written in Rust, providing 50-80x faster analysis compared to traditional Python linters.

## Features

- ⚡ **Lightning Fast**: 50-80x faster than Pylint on real codebases
- 🎯 **High Accuracy**: 97.8% accuracy on implemented error codes
- 🦀 **Rust-Powered**: Built with Rust for maximum performance
- 📦 **Easy Installation**: Simple pip install with no complex dependencies
- 🔍 **Growing Coverage**: Actively expanding error detection capabilities

## Installation

```bash
pip install prylint
```

## Usage

### Command Line

```bash
# Lint a single file
prylint script.py

# Lint a directory
prylint src/

# Output as JSON
prylint --json script.py

# Lint without recursion
prylint --no-recursive src/
```

### Python API

```python
from prylint import lint_file, lint_directory

# Lint a single file
issues = lint_file("script.py")
for issue in issues:
    print(f"{issue.file}:{issue.line}: {issue.code} {issue.message}")

# Lint a directory
issues = lint_directory("src/", recursive=True)
```

## Supported Error Codes

Prylint currently implements 35 error codes from the Pylint error code set:

### Fully Implemented (17)

- **E0001**: Syntax errors
- **E0100**: `__init__` method is a generator
- **E0101**: Explicit return in `__init__`
- **E0102**: Function/method redefined
- **E0103**: break/continue not in loop
- **E0104**: Return outside function
- **E0105**: Yield outside function
- **E0106**: Return with argument in generator
- **E0108**: Duplicate argument names
- **E0109**: Duplicate dictionary keys
- **E0112**: Too many starred expressions
- **E0115**: Name is nonlocal and global
- **E0116**: Continue not in loop
- **E0117**: Nonlocal without binding
- **E0118**: Used before global declaration
- **E0606**: Possibly used before assignment
- **E0704**: Misplaced bare raise
- **E0711**: NotImplemented raised
- **E1142**: await outside async

### Partially Implemented (18)

Additional error codes with partial support for common cases.

## Performance

Benchmark results on real Python codebases:

| Linter  | Time  | Speedup |
| ------- | ----- | ------- |
| Pylint  | 11.2s | 1x      |
| Prylint | 0.22s | 50x     |

## Why Prylint?

Prylint is designed for developers who want:

- Fast feedback during development
- Integration with CI/CD pipelines without slowing builds
- A modern, performant alternative to traditional linters
- Focus on catching real errors, not style issues

## Contributing

Contributions are welcome! Please feel free to submit issues and pull requests on [GitHub](https://github.com/adamraudonis/prylint).

## License

MIT License - see LICENSE file for details.

## Roadmap

- [ ] Expand error code coverage
- [ ] Add configuration file support
- [ ] Implement auto-fix capabilities
- [ ] Add IDE integrations
- [ ] Support for custom rules

## Credits

Built with ❤️ using:

- [RustPython Parser](https://github.com/RustPython/RustPython) for Python AST parsing
- [PyO3](https://github.com/PyO3/pyo3) for Python bindings
