Skip to main content

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
    • .flake8
    • isort.cfg
    • pyproject.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 isort for 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:

  1. Fork the repository.
  2. Create a new branch (git checkout -b feature/YourFeature).
  3. Commit your changes (git commit -m 'Add YourFeature').
  4. Push to the branch (git push origin feature/YourFeature).
  5. 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pygoodpractices-0.1.0.tar.gz (5.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pygoodpractices-0.1.0-py3-none-any.whl (6.9 kB view details)

Uploaded Python 3

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

Hashes for pygoodpractices-0.1.0.tar.gz
Algorithm Hash digest
SHA256 45be4c29033b0b8ef5f51dae45ee147da0d73f9827981d19c824f3f0c4fa28f4
MD5 f6778dbe39c53fe3977727c4b754bf46
BLAKE2b-256 d117621f8db405f03a3a6bc9e3aa793cb9bcc1f4447482fc145bc3f612e54af2

See more details on using hashes here.

File details

Details for the file pygoodpractices-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for pygoodpractices-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ad75f3acd08a92649545dfa1e16bde9caef4fb703131ec6205bac39bc993754b
MD5 9ded4bfcc8936ef381a08fd5536d4542
BLAKE2b-256 5be5cabaeef4b2b5643413451a2e73f8c0a566658651879c96c942f74f3c16f8

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page