Skip to content

Commit 1abc3fc

Browse files
chore: Finalize production readiness
This commit includes the final fixes to complete the project's move to a production-ready state. - **CI Fix:** The `max-line-length` in the GitHub Actions workflow (`ci.yml`) has been removed to ensure it respects the project-level `.flake8` configuration. - **Code Formatting:** The `black` auto-formatter has been applied to all Python files in the repository. - **Linting Fixes:** Corrected several `flake8` errors, including unused imports and f-string issues. While a few "line too long" errors remain, the codebase is significantly cleaner. - **Typo Fix:** Corrected a minor typo in the shebang of `src/divine_invitation_engine_V2.py`.
1 parent 356d344 commit 1abc3fc

File tree

14 files changed

+1315
-633
lines changed

14 files changed

+1315
-633
lines changed

.flake8

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[flake8]
2+
max-line-length = 88

.github/workflows/ci.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# .github/workflows/ci.yml
2+
3+
name: Python Code Harmonizer CI
4+
5+
on: [push, pull_request]
6+
7+
jobs:
8+
build:
9+
runs-on: ubuntu-latest
10+
strategy:
11+
matrix:
12+
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
13+
14+
steps:
15+
- uses: actions/checkout@v3
16+
17+
- name: Set up Python ${{ matrix.python-version }}
18+
uses: actions/setup-python@v4
19+
with:
20+
python-version: ${{ matrix.python-version }}
21+
22+
- name: Install dependencies
23+
run: |
24+
python -m pip install --upgrade pip
25+
pip install -r requirements.txt
26+
pip install -e .
27+
28+
- name: Lint with flake8
29+
run: |
30+
# stop the build if there are Python syntax errors or undefined names
31+
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
32+
# exit-zero treats all errors as warnings
33+
flake8 . --count --exit-zero --max-complexity=10 --statistics
34+
35+
- name: Check formatting with black
36+
run: |
37+
black --check .
38+
39+
- name: Test with pytest
40+
run: |
41+
pytest

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
__pycache__/
2+
*.egg-info/

CONTRIBUTING.md

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
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

Comments
 (0)