A custom PEP 8 checker module
Project description
CodeLint
CodeLint is a lightweight Python module that ensures your code complies with PEP 8 standards. By identifying common issues like long lines, incorrect indentation, inconsistent naming conventions, and unnecessary whitespace, CodeLint helps you write clean, professional, and maintainable Python code.
Table of Contents
Key Features
- Line Length Check: Flags lines exceeding a specified maximum length.
- Indentation Check: Detects incorrect visual indentation (e.g., mixed tabs and spaces).
- Snake Case Check: Ensures variable and function names follow the
snake_case
naming convention. - Whitespace Check: Identifies trailing whitespace and excessive blank lines.
Installation
Install CodeLint easily using pip
:
pip install codelint
Usage
CodeLint can be run directly from the terminal to analyze Python files for PEP 8 violations.
Command:
codelint <file.py>
Example:
>> pip install codelint
>> codelint my_script.py
Running Tests with Pytest
CodeLint includes comprehensive tests to ensure functionality and reliability. Follow these steps to run the test suite:
-
Clone the repository:
git clone https://github.com/Aditya-1998k/CodeLint.git
-
Navigate to the project directory:
cd CodeLint
-
Install
pytest
:pip install pytest
-
Run the tests:
pytest tests/test_checker.py
Example:
How It Works
CodeLint scans your Python files for the following issues:
- Line Length: Checks for lines that exceed the standard maximum length (default is 79 characters).
- Indentation: Ensures consistent indentation (e.g., no mixing of tabs and spaces).
- Snake Case Naming: Verifies that function and variable names adhere to PEP 8's
snake_case
standard. - Trailing Whitespace: Identifies and flags any trailing spaces at the end of lines.
- Excessive Blank Lines: Warns about more than one consecutive blank line.
Contributing
We welcome contributions from the community! To contribute:
- Fork the repository.
- Create a new branch for your feature:
git checkout -b feature-name
- Commit your changes:
git commit -m "Add feature-name"
- Push to your branch:
git push origin feature-name
- Submit a pull request.
License
CodeLint is licensed under the MIT License. See the LICENSE file for details.
CodeLint helps you maintain high coding standards effortlessly. Install today and ensure your Python projects adhere to best practices! 🚀
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
Built Distribution
File details
Details for the file codelint-0.1.7.tar.gz
.
File metadata
- Download URL: codelint-0.1.7.tar.gz
- Upload date:
- Size: 5.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1e9c40db01665696412acabb3f9f62c6ddb942d96286eeb5bf7b8634085e2eea |
|
MD5 | 59d6172c8416dea9911df44522522a51 |
|
BLAKE2b-256 | 36c64ac2fd52f16072c8dde5345eab77f49a87f011faf9f84b962a63749c83d5 |
File details
Details for the file codelint-0.1.7-py3-none-any.whl
.
File metadata
- Download URL: codelint-0.1.7-py3-none-any.whl
- Upload date:
- Size: 5.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3b25b88ea30f119504d46507adec30aeab3de297aa56790d6c9c75f2457579c1 |
|
MD5 | d0e8f2b0f7a3d3a77025e77a376c633e |
|
BLAKE2b-256 | 10564c20b9db633ab0f69e9426d53b59b8f35b072a0ae37eb3168024b8df6a59 |