You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've ran the linters locally and fixed lint errors related to the files I modified in this PR. You can install the linters by running pip install -r requirements-dev.txt && pre-commit install
I tried to run pre-commit but hit the errors below. These appear to be pre-existing legacy lint issues in the two files touched by this PR that do not comply with the current Ruff configuration, rather than issues introduced by the P200 changes. ruff-check reported 53 errors; it automatically fixed 5 but left 48 unresolved, including deprecated typing.Dict/typing.List annotations, naming-rule violations, function-complexity limits, and a missing ClassVar annotation. ruff-format also reformatted both files. Since these changes are unrelated to this PR, I reverted the automatic fixes and formatting changes and used --no-verify to keep the PR scoped to the intended P200 changes. It looks like these files need a one-time cleanup or appropriate Ruff baselining.
Pre-commit errors
ruff check...............................................................Failed
- hook id: ruff-check
- exit code: 1
- files were modified by this hook
fboss/lib/platform_mapping_v2/read_files_utils.py:7:1: UP035 `typing.Dict` is deprecated, use `dict` instead
fboss/lib/platform_mapping_v2/read_files_utils.py:7:1: UP035 `typing.List` is deprecated, use `list` instead
fboss/lib/platform_mapping_v2/read_files_utils.py:56:47: UP006 Use `dict` instead of `Dict` for type annotation
fboss/lib/platform_mapping_v2/read_files_utils.py:73:31: UP006 Use `dict` instead of `Dict` for type annotation
fboss/lib/platform_mapping_v2/read_files_utils.py:73:41: UP006 Use `dict` instead of `Dict` for type annotation
fboss/lib/platform_mapping_v2/read_files_utils.py:89:28: UP006 Use `dict` instead of `Dict` for type annotation
fboss/lib/platform_mapping_v2/read_files_utils.py:104:35: UP006 Use `list` instead of `List` for type annotation
fboss/lib/platform_mapping_v2/read_files_utils.py:108:35: UP006 Use `dict` instead of `Dict` for type annotation
fboss/lib/platform_mapping_v2/read_files_utils.py:126:36: UP006 Use `dict` instead of `Dict` for type annotation
fboss/lib/platform_mapping_v2/read_files_utils.py:127:5: N806 Variable `STATIC_MAPPING_SUFFIX` in function should be lowercase
fboss/lib/platform_mapping_v2/read_files_utils.py:128:5: N806 Variable `Column` in function should be lowercase
fboss/lib/platform_mapping_v2/read_files_utils.py:222:5: PLR0912 Too many branches (14 > 12)
fboss/lib/platform_mapping_v2/read_files_utils.py:223:16: UP006 Use `dict` instead of `Dict` for type annotation
fboss/lib/platform_mapping_v2/read_files_utils.py:225:5: N806 Variable `PORT_PROFILE_MAPPING_SUFFIX` in function should be lowercase
fboss/lib/platform_mapping_v2/read_files_utils.py:226:5: N806 Variable `Column` in function should be lowercase
fboss/lib/platform_mapping_v2/read_files_utils.py:304:41: UP006 Use `dict` instead of `Dict` for type annotation
fboss/lib/platform_mapping_v2/read_files_utils.py:304:73: UP006 Use `dict` instead of `Dict` for type annotation
fboss/lib/platform_mapping_v2/read_files_utils.py:305:5: N806 Variable `PLATFORM_DESCRIPTOR_SUFFIX` in function should be lowercase
fboss/lib/platform_mapping_v2/read_files_utils.py:306:5: N806 Variable `VARIANT_ATTRIBUTES_COLUMN` in function should be lowercase
fboss/lib/platform_mapping_v2/read_files_utils.py:307:5: N806 Variable `Column` in function should be lowercase
fboss/lib/platform_mapping_v2/read_files_utils.py:341:38: UP006 Use `dict` instead of `Dict` for type annotation
fboss/lib/platform_mapping_v2/read_files_utils.py:342:5: N806 Variable `PROFILE_SETTINGS_SUFFIX` in function should be lowercase
fboss/lib/platform_mapping_v2/read_files_utils.py:343:5: N806 Variable `Column` in function should be lowercase
fboss/lib/platform_mapping_v2/read_files_utils.py:415:5: PLR0912 Too many branches (76 > 12)
fboss/lib/platform_mapping_v2/read_files_utils.py:415:5: PLR0915 Too many statements (181 > 50)
fboss/lib/platform_mapping_v2/read_files_utils.py:416:16: UP006 Use `dict` instead of `Dict` for type annotation
fboss/lib/platform_mapping_v2/read_files_utils.py:419:5: N806 Variable `SI_SETTINGS_SUFFIX` in function should be lowercase
fboss/lib/platform_mapping_v2/read_files_utils.py:420:5: N806 Variable `CUSTOM_TX_PREFIX` in function should be lowercase
fboss/lib/platform_mapping_v2/read_files_utils.py:421:5: N806 Variable `CUSTOM_RX_PREFIX` in function should be lowercase
fboss/lib/platform_mapping_v2/read_files_utils.py:424:5: N806 Variable `Column` in function should be lowercase
fboss/lib/platform_mapping_v2/read_files_utils.py:434:13: N806 Variable `Column` in function should be lowercase
fboss/lib/platform_mapping_v2/read_files_utils.py:519:20: UP006 Use `dict` instead of `Dict` for type annotation
fboss/lib/platform_mapping_v2/read_files_utils.py:637:20: UP006 Use `dict` instead of `Dict` for type annotation
fboss/lib/platform_mapping_v2/read_files_utils.py:861:40: UP006 Use `dict` instead of `Dict` for type annotation
fboss/lib/platform_mapping_v2/read_files_utils.py:862:5: N806 Variable `VENDOR_CONFIG_SUFFIX` in function should be lowercase
fboss/lib/platform_mapping_v2/read_files_utils.py:866:30: A002 Function argument `map` is shadowing a Python builtin
fboss/lib/platform_mapping_v2/read_files_utils.py:866:35: UP006 Use `dict` instead of `Dict` for type annotation
fboss/lib/platform_mapping_v2/read_files_utils.py:866:54: UP006 Use `dict` instead of `Dict` for type annotation
fboss/lib/platform_mapping_v2/read_files_utils.py:903:16: UP006 Use `dict` instead of `Dict` for type annotation
fboss/lib/platform_mapping_v2/read_files_utils.py:905:5: N806 Variable `SUFFIX` in function should be lowercase
fboss/lib/platform_mapping_v2/read_files_utils.py:906:5: N806 Variable `Column` in function should be lowercase
fboss/lib/platform_mapping_v2/test/verify_generated_files.py:8:1: UP035 `typing.Dict` is deprecated, use `dict` instead
fboss/lib/platform_mapping_v2/test/verify_generated_files.py:8:1: UP035 `typing.List` is deprecated, use `list` instead
fboss/lib/platform_mapping_v2/test/verify_generated_files.py:12:5: N811 Constant `INPUT_DIR` imported as non-constant `input_dir`
fboss/lib/platform_mapping_v2/test/verify_generated_files.py:25:41: UP006 Use `dict` instead of `Dict` for type annotation
fboss/lib/platform_mapping_v2/test/verify_generated_files.py:25:52: UP006 Use `list` instead of `List` for type annotation
fboss/lib/platform_mapping_v2/test/verify_generated_files.py:25:65: RUF012 Mutable class attributes should be annotated with `typing.ClassVar`
fboss/lib/platform_mapping_v2/test/verify_generated_files.py:122:54: UP006 Use `list` instead of `List` for type annotation
Found 53 errors (5 fixed, 48 remaining).
No fixes available (21 hidden fixes can be enabled with the `--unsafe-fixes` option).
ruff format..............................................................Failed
- hook id: ruff-format
- files were modified by this hook
2 files reformatted
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
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.
Pre-submission checklist
pip install -r requirements-dev.txt && pre-commit installpre-commit runSummary
Test Plan