A tool to set up pre-commit hooks automatically
Project description
pygoodpractices
pygoodpractices is a Python tool designed to automate the setup of pre-commit hooks and standard configuration files, promoting best practices in Python projects.
Table of Contents
Features
- Automatically generates configuration files:
.pre-commit-config.yaml.flake8isort.cfgpyproject.toml
- Installs and initializes pre-commit hooks.
- Ensures code quality and consistency across projects.
Installation
Ensure you have Python 3.6 or later installed. You can install pygoodpractices using pip:
pip install pygoodpractices
Alternatively, clone the repository and install it locally:
git clone https://github.com/yourusername/pygoodpractices.git
cd pygoodpractices
pip install .
Usage
After installation, you can set up your project with the following commands:
setup-pygoodpractices
install-pygoodpractices
pygood-init: Generates the necessary configuration files in your project directory and Installs and initializes the pre-commit hooks.pygood --all: Runs all pre-commit hooks on every file in the repository, ensuring code follows best practices before committing.pygood --files <file1> <file2> <file3>: Runs all pre-commit hooks on specified files , ensuring code follows best practices before committing.
Configuration Files
The tool generates the following configuration files:
- ``: Configures pre-commit hooks.
- ``: Sets rules for Flake8, a Python linting tool.
- ``: Configures
isortfor sorting imports. - ``: Contains project metadata and tool configurations.
Feel free to customize these files to fit your project's specific needs.
Contributing
Contributions are welcome! Please follow these steps:
- Fork the repository.
- Create a new branch (
git checkout -b feature/YourFeature). - Commit your changes (
git commit -m 'Add YourFeature'). - Push to the branch (
git push origin feature/YourFeature). - Open a Pull Request.
Ensure your code adheres to the existing style and passes all tests. For more details, see the CONTRIBUTING.md file.
License
This project is licensed under the MIT License. See the LICENSE file for details.
Contact
For questions or suggestions, please open an issue or contact petudeveloper.
Project details
Release history Release notifications | RSS feed
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pygoodpractices-0.1.0.tar.gz.
File metadata
- Download URL: pygoodpractices-0.1.0.tar.gz
- Upload date:
- Size: 5.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.10.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
45be4c29033b0b8ef5f51dae45ee147da0d73f9827981d19c824f3f0c4fa28f4
|
|
| MD5 |
f6778dbe39c53fe3977727c4b754bf46
|
|
| BLAKE2b-256 |
d117621f8db405f03a3a6bc9e3aa793cb9bcc1f4447482fc145bc3f612e54af2
|
File details
Details for the file pygoodpractices-0.1.0-py3-none-any.whl.
File metadata
- Download URL: pygoodpractices-0.1.0-py3-none-any.whl
- Upload date:
- Size: 6.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.10.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ad75f3acd08a92649545dfa1e16bde9caef4fb703131ec6205bac39bc993754b
|
|
| MD5 |
9ded4bfcc8936ef381a08fd5536d4542
|
|
| BLAKE2b-256 |
5be5cabaeef4b2b5643413451a2e73f8c0a566658651879c96c942f74f3c16f8
|