-
Notifications
You must be signed in to change notification settings - Fork 1
Update guidelines for Python 3.11 and lint settings #7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
tblakex01
wants to merge
1
commit into
main
Choose a base branch
from
codex/create-agents.md-with-setup-instructions
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,38 @@ | ||
| # Repository Guidelines | ||
|
|
||
| These instructions apply to the entire repository. Follow them when modifying or adding files. | ||
|
|
||
| ## Environment Setup | ||
| - Use **Python 3.11+**. | ||
| - Install dependencies: | ||
| ```bash | ||
| pip install -r requirements.txt | ||
| pip install black flake8 # development tools | ||
| ``` | ||
| - Verify that all imported modules are listed in `requirements.txt`: | ||
| ```bash | ||
| python utils/verify_requirements.py | ||
| ``` | ||
|
|
||
| ## Formatting | ||
| - Format code with **Black** before committing: | ||
| ```bash | ||
| black . | ||
| ``` | ||
| - Use the default line length (88 characters) and 4‑space indentation. | ||
|
|
||
| ## Linting | ||
| - Run **flake8** and resolve all issues: | ||
| ```bash | ||
| flake8 --max-line-length=120 | ||
| ``` | ||
|
|
||
| ## Testing | ||
| - Execute the test suite with **pytest** and ensure it passes: | ||
| ```bash | ||
| pytest -v | ||
| ``` | ||
|
|
||
| ## Pull Requests | ||
| - Make concise, focused commits using present‑tense messages (e.g., "Add combo detection module"). | ||
| - Verify formatting, linting, and tests succeed before submitting a PR. | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -4,21 +4,22 @@ | |||||
|
|
||||||
| from utils.data_manager import DataManager | ||||||
|
|
||||||
|
|
||||||
| def test_create_and_save_session(): | ||||||
| with tempfile.TemporaryDirectory() as tmpdir: | ||||||
| dm = DataManager(data_dir=tmpdir) | ||||||
| dm.create_new_session() | ||||||
| session_data = { | ||||||
| 'date': '2023-01-01 00:00:00', | ||||||
| 'duration': 10.0, | ||||||
| 'total_punches': 5, | ||||||
| 'punch_types': {'jab': 2, 'cross': 3}, | ||||||
| 'punches_per_minute': 30.0 | ||||||
| "date": "2023-01-01 00:00:00", | ||||||
| "duration": 10.0, | ||||||
| "total_punches": 5, | ||||||
| "punch_types": {"jab": 2, "cross": 3}, | ||||||
| "punches_per_minute": 30.0, | ||||||
| } | ||||||
| dm.save_session_data(session_data) | ||||||
| hist = dm.get_historical_data() | ||||||
| assert len(hist) == 1 | ||||||
| assert hist[0]['total_punches'] == 5 | ||||||
| assert hist[0]["total_punches"] == 5 | ||||||
|
|
||||||
|
|
||||||
| def test_json_backup_write_failure(tmp_path, capsys): | ||||||
|
|
@@ -27,11 +28,11 @@ def test_json_backup_write_failure(tmp_path, capsys): | |||||
| dm = DataManager(data_dir=data_dir) | ||||||
| dm.create_new_session() | ||||||
| session_data = { | ||||||
| 'date': '2023-01-01 00:00:00', | ||||||
| 'duration': 5.0, | ||||||
| 'total_punches': 2, | ||||||
| 'punch_types': {'jab': 2}, | ||||||
| 'punches_per_minute': 24.0 | ||||||
| "date": "2023-01-01 00:00:00", | ||||||
| "duration": 5.0, | ||||||
| "total_punches": 2, | ||||||
| "punch_types": {"jab": 2}, | ||||||
| "punches_per_minute": 24.0, | ||||||
| } | ||||||
|
|
||||||
| os.chmod(data_dir, 0o500) | ||||||
|
|
@@ -40,4 +41,4 @@ def test_json_backup_write_failure(tmp_path, capsys): | |||||
|
|
||||||
| output = capsys.readouterr().out | ||||||
| assert "Failed to write backup file" in output | ||||||
| assert len(list(data_dir.glob('session_*.json'))) == 0 | ||||||
| assert len(list(data_dir.glob("session_*.json"))) == 0 | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. suggestion (code-quality): Simplify sequence length comparison (
Suggested change
|
||||||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Inconsistent line-length settings. The Formatting section mandates Black’s default (88 chars) while Linting uses
--max-line-length=120. Align these values to avoid confusion.Also applies to: 27-28
🤖 Prompt for AI Agents