Batt specifications#1477
Conversation
…te checks The elif branches in battery monitor and GNSS protocol lookups were unreachable because all conn_type values in BATT_MONITOR_CONNECTION and GNSS_RECEIVER_CONNECTION are list objects. The Battery Monitor ESC duplicate-connection allowance was also unreachable: BATT_MONITOR=9 maps to type "other", which is never a serial port and therefore never triggers the duplicate check.
- Add config:best-practices to extends (pins digests, GitHub Action digests, config migration, dev dep pinning, abandonment alerts, npm min release age) - Enable dependencyDashboard (currently false, required by best practices) - Add minimumReleaseAge: "14 days" to the automerge rule — prevents merging malicious packages before registries can pull them - Enable osvVulnerabilityAlerts and vulnerabilityAlerts
There was a problem hiding this comment.
Pull request overview
Updates Renovate configuration and refines vehicle component validation logic, with a focus on battery/connection-related choices and validation behavior.
Changes:
- Enable Renovate best-practices + semantic commits, turn on dependency dashboard and vulnerability alert features, and add a minimum release age for pre-commit automerge.
- Simplify protocol-choice filtering logic for Battery Monitor and GNSS Receiver connection types.
- Adjust validation code by removing a duplicate-connection exception and changing
validate_entry_limitsdefinition metadata.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| renovate.json | Adopts Renovate recommended presets, enables dashboards/alerts, and adds pre-commit update aging before automerge. |
| ardupilot_methodic_configurator/data_model_vehicle_components_validation.py | Simplifies connection-type/protocol filtering and tweaks validation/duplicate-connection handling. |
| ) | ||
|
|
||
| def validate_entry_limits(self, value: str, path: ComponentPath) -> tuple[str, Optional[float]]: # noqa: PLR0911 # pylint: disable=too-many-return-statements | ||
| def validate_entry_limits(self, value: str, path: ComponentPath) -> tuple[str, Optional[float]]: |
There was a problem hiding this comment.
validate_entry_limits still contains many early returns (e.g., type conversion errors, range checks, TOW min/max cross-validation, and delegation to validate_cell_voltage). Since Ruff is configured to lint PLR rules (including PLR0911 too-many-return-statements), removing the previous # noqa: PLR0911 / pylint disable will likely make this file fail linting. Consider re-adding the suppression for this function or refactoring to reduce the number of return statements (e.g., accumulate an (error, corrected) result and return once).
| def validate_entry_limits(self, value: str, path: ComponentPath) -> tuple[str, Optional[float]]: | |
| def validate_entry_limits( # noqa: PLR0911 # pylint: disable=too-many-return-statements | |
| self, value: str, path: ComponentPath | |
| ) -> tuple[str, Optional[float]]: |
…ring nr of return statements down.
5a5ac2c to
e14775a
Compare
☂️ Python Coverage
Overall Coverage
New FilesNo new covered files... Modified FilesNo covered modified files...
|
Test Results 4 files 4 suites 41m 35s ⏱️ Results for commit e14775a. |
No description provided.