mirror of
https://github.com/AkitaEngineering/Akita-Meshtastic-Meshcore-Bridge.git
synced 2026-03-28 17:42:42 +01:00
docs: add flake8 config and linting policy; add changelog entry
This commit is contained in:
11
.flake8
Normal file
11
.flake8
Normal file
@@ -0,0 +1,11 @@
|
||||
[flake8]
|
||||
max-line-length = 79
|
||||
exclude =
|
||||
.venv,
|
||||
.git,
|
||||
__pycache__,
|
||||
build,
|
||||
dist,
|
||||
.eggs,
|
||||
*.egg-info
|
||||
ignore = E203,W503
|
||||
11
CHANGELOG.md
11
CHANGELOG.md
@@ -1,6 +1,15 @@
|
||||
# Changelog - Major Enhancements
|
||||
|
||||
**Last Updated: December 31, 2025**
|
||||
**Last Updated: January 22, 2026**
|
||||
|
||||
## Unreleased
|
||||
|
||||
### Maintenance
|
||||
- **Added** `.flake8` configuration to exclude `.venv` from linting to avoid third-party noise in CI and local runs.
|
||||
- **Documented** project linting policy (79-char E501 limit, prefer wrapping and parameterized logging, and do not edit third-party site-packages).
|
||||
- **Fixed** project E501 and other flake8 issues in `ammb/` and `examples/`; tests and `mypy` were run and verified clean.
|
||||
|
||||
---
|
||||
|
||||
## Version 2.0.0 - Comprehensive Code Review and Enhancements (December 31, 2025)
|
||||
|
||||
|
||||
@@ -114,6 +114,15 @@ We use `flake8` for checking code style against PEP 8 guidelines and common erro
|
||||
flake8 ammb/bridge.py
|
||||
```
|
||||
|
||||
### Project linting policy ✅
|
||||
|
||||
- **Max line length:** 79 characters (flake8 E501). When long lines are found, prefer **targeted wrapping or splitting** (for example: split long strings, break complex expressions, or use short helper variables) rather than increasing the line length limit.
|
||||
- **Third-party packages:** Do **not** edit files under `.venv` or other external package directories to satisfy linter rules. Instead, exclude those directories from lint runs (we include `.venv` in the project's `.flake8` file).
|
||||
- **Logging:** Prefer parameterized logging calls (e.g., `logger.info("Connected to %s", port)`) instead of long f-strings to keep messages shorter and avoid unnecessary formatting overhead.
|
||||
- **Fix process:** When addressing E501 issues in project files, make conservative, behavior-preserving edits (wrap strings, reflow docstrings, or adjust logging). Re-run tests and `mypy` after each change to ensure no regressions.
|
||||
|
||||
Example: In this revision we fixed several E501 cases in `ammb/` and `examples/` by wrapping long strings and using parameterized logging; tests and `mypy` were re-run to confirm the project remains correct.
|
||||
|
||||
## Static Type Checking
|
||||
|
||||
We use `mypy` for static type checking to catch potential type-related errors before runtime.
|
||||
|
||||
Reference in New Issue
Block a user