|
| 1 | +# Contributing to the Python Code Harmonizer |
| 2 | + |
| 3 | +First off, thank you for considering contributing! This project is a unique blend of philosophy and code, and your help is welcome in making it better. |
| 4 | + |
| 5 | +## Getting Started |
| 6 | + |
| 7 | +To get the project set up for local development, please follow these steps: |
| 8 | + |
| 9 | +1. **Fork and Clone:** |
| 10 | + * Fork the repository on GitHub. |
| 11 | + * Clone your fork to your local machine: |
| 12 | + ```sh |
| 13 | + git clone https://github.com/YOUR_USERNAME/Python-Code-Harmonizer.git |
| 14 | + cd Python-Code-Harmonizer |
| 15 | + ``` |
| 16 | + |
| 17 | +2. **Set Up a Virtual Environment:** |
| 18 | + * It is highly recommended to use a virtual environment to keep dependencies isolated. |
| 19 | + ```sh |
| 20 | + python -m venv .venv |
| 21 | + source .venv/bin/activate |
| 22 | + ``` |
| 23 | + |
| 24 | +3. **Install Dependencies:** |
| 25 | + * The project and all its development dependencies can be installed with a single command. The `-e` flag installs the project in "editable" mode, which is essential for development. |
| 26 | + ```sh |
| 27 | + pip install -r requirements.txt |
| 28 | + pip install -e . |
| 29 | + ``` |
| 30 | + |
| 31 | +## Running the Tools |
| 32 | + |
| 33 | +### Running the Harmonizer |
| 34 | + |
| 35 | +Once installed, you can run the harmonizer on any Python file using the `harmonizer` command-line script: |
| 36 | + |
| 37 | +```sh |
| 38 | +harmonizer examples/test_code.py |
| 39 | +``` |
| 40 | + |
| 41 | +### Running the Test Suite |
| 42 | + |
| 43 | +This project uses `pytest` for testing. To run the full suite: |
| 44 | + |
| 45 | +```sh |
| 46 | +pytest |
| 47 | +``` |
| 48 | + |
| 49 | +## Code Quality and Style |
| 50 | + |
| 51 | +We use `black` for code formatting and `flake8` for linting to ensure a consistent and high-quality codebase. |
| 52 | + |
| 53 | +### Formatting |
| 54 | + |
| 55 | +Before you commit your changes, please run `black` to automatically format your code: |
| 56 | + |
| 57 | +```sh |
| 58 | +black src/ tests/ |
| 59 | +``` |
| 60 | + |
| 61 | +### Linting |
| 62 | + |
| 63 | +You can check for any style issues or potential errors with `flake8`: |
| 64 | + |
| 65 | +```sh |
| 66 | +flake8 src/ tests/ |
| 67 | +``` |
| 68 | + |
| 69 | +Our Continuous Integration (CI) pipeline will automatically check for formatting and linting issues, so it's a good idea to run these tools locally before pushing your changes. |
| 70 | +
|
| 71 | +## Submitting a Pull Request |
| 72 | +
|
| 73 | +1. Create a new branch for your feature or bug fix. |
| 74 | +2. Make your changes, and be sure to add tests if you are adding new functionality. |
| 75 | +3. Ensure your code is formatted with `black` and passes the `flake8` checks. |
| 76 | +4. Make sure the full test suite passes with `pytest`. |
| 77 | +5. Push your branch to your fork and open a pull request. |
| 78 | +
|
| 79 | +Thank you for your contributions! |
0 commit comments