-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
refactor: Compile time enforcement that all top level lint options are checked for deprecation #12037
refactor: Compile time enforcement that all top level lint options are checked for deprecation #12037
Conversation
…e tested for deprecation
|
code | total | + violation | - violation | + fix | - fix |
---|---|---|---|---|---|
ANN101 | 35381 | 0 | 35381 | 0 | 0 |
ANN102 | 674 | 0 | 674 | 0 | 0 |
E721 | 556 | 312 | 244 | 0 | 0 |
S603 | 454 | 227 | 227 | 0 | 0 |
S610 | 22 | 22 | 0 | 0 | 0 |
S602 | 21 | 11 | 10 | 0 | 0 |
S604 | 16 | 8 | 8 | 0 | 0 |
PLR1701 | 11 | 0 | 11 | 0 | 0 |
S605 | 8 | 4 | 4 | 0 | 0 |
D107 | 2 | 1 | 1 | 0 | 0 |
RUF100 | 1 | 1 | 0 | 0 | 0 |
RUF024 | 1 | 1 | 0 | 0 | 0 |
Linter (preview)
ℹ️ ecosystem check detected linter changes. (+251 -260 violations, +0 -0 fixes in 6 projects; 44 projects unchanged)
apache/airflow (+171 -174 violations, +0 -0 fixes)
ruff check --no-cache --exit-zero --ignore RUF9 --output-format concise --preview --select ALL
+ airflow/cli/commands/dag_command.py:309:14: S603 `subprocess` call: check for execution of untrusted input - airflow/cli/commands/dag_command.py:309:31: S603 `subprocess` call: check for execution of untrusted input + airflow/cli/commands/info_command.py:199:18: S603 `subprocess` call: check for execution of untrusted input - airflow/cli/commands/info_command.py:199:35: S603 `subprocess` call: check for execution of untrusted input + airflow/cli/commands/internal_api_command.py:166:17: S603 `subprocess` call: check for execution of untrusted input - airflow/cli/commands/internal_api_command.py:166:34: S603 `subprocess` call: check for execution of untrusted input + airflow/cli/commands/internal_api_command.py:179:22: S603 `subprocess` call: check for execution of untrusted input ... 296 additional changes omitted for rule S603 + airflow/example_dags/example_kubernetes_executor.py:132:35: S605 Starting a process with a shell: seems safe, but may be changed in the future; consider rewriting without `shell` - airflow/example_dags/example_kubernetes_executor.py:132:45: S605 Starting a process with a shell: seems safe, but may be changed in the future; consider rewriting without `shell` + airflow/example_dags/example_kubernetes_executor.py:94:27: S605 Starting a process with a shell: seems safe, but may be changed in the future; consider rewriting without `shell` - airflow/example_dags/example_kubernetes_executor.py:94:37: S605 Starting a process with a shell: seems safe, but may be changed in the future; consider rewriting without `shell` + airflow/providers/apache/beam/hooks/beam.py:575:25: S604 Function call with `shell=True` parameter identified, security issue - airflow/providers/apache/beam/hooks/beam.py:577:13: S604 Function call with `shell=True` parameter identified, security issue - airflow/providers/microsoft/azure/hooks/msgraph.py:327:12: PLR1701 [*] Merge `isinstance` calls: `isinstance(data, (BytesIO, bytes, str))` - airflow/serialization/pydantic/dag.py:45:9: PLR1701 [*] Merge `isinstance` calls - airflow/serialization/pydantic/taskinstance.py:70:8: PLR1701 [*] Merge `isinstance` calls: `isinstance(x, (BaseOperator, MappedOperator))` + dev/breeze/src/airflow_breeze/commands/kubernetes_commands.py:1082:13: S604 Function call with `shell=True` parameter identified, security issue - dev/breeze/src/airflow_breeze/commands/kubernetes_commands.py:1091:17: S604 Function call with `shell=True` parameter identified, security issue + dev/breeze/src/airflow_breeze/commands/kubernetes_commands.py:1094:13: S604 Function call with `shell=True` parameter identified, security issue - dev/breeze/src/airflow_breeze/commands/kubernetes_commands.py:1103:17: S604 Function call with `shell=True` parameter identified, security issue + dev/breeze/src/airflow_breeze/commands/kubernetes_commands.py:1106:13: S604 Function call with `shell=True` parameter identified, security issue ... 10 additional changes omitted for rule S604 + hatch_build.py:660:13: S602 `subprocess` call with `shell=True` identified, security issue - hatch_build.py:660:59: S602 `subprocess` call with `shell=True` identified, security issue + hatch_build.py:673:13: S602 `subprocess` call with `shell=True` identified, security issue - hatch_build.py:673:59: S602 `subprocess` call with `shell=True` identified, security issue + scripts/ci/pre_commit/ruff_format.py:26:1: S602 `subprocess` call with `shell=True` identified, security issue - scripts/ci/pre_commit/ruff_format.py:26:33: S602 `subprocess` call with `shell=True` identified, security issue + tests/dags/test_on_kill.py:44:13: S605 Starting a process with a shell: seems safe, but may be changed in the future; consider rewriting without `shell` - tests/dags/test_on_kill.py:44:23: S605 Starting a process with a shell: seems safe, but may be changed in the future; consider rewriting without `shell` + tests/system/providers/amazon/aws/example_emr_eks.py:102:13: S602 `subprocess` call with `shell=True` identified, security issue ... 10 additional changes omitted for rule S602 - tests/task/task_runner/test_standard_task_runner.py:340:19: S605 Starting a process with a shell, possible injection detected ... 2 additional changes omitted for rule S605 ... 314 additional changes omitted for project
bokeh/bokeh (+38 -38 violations, +0 -0 fixes)
ruff check --no-cache --exit-zero --ignore RUF9 --output-format concise --preview --select ALL
+ examples/output/apis/server_document/flask_server.py:45:17: S603 `subprocess` call: check for execution of untrusted input - examples/output/apis/server_document/flask_server.py:46:5: S603 `subprocess` call: check for execution of untrusted input + release/system.py:43:18: S602 `subprocess` call with `shell=True` identified, security issue - release/system.py:43:34: S602 `subprocess` call with `shell=True` identified, security issue - scripts/hooks/install.py:5:20: S603 `subprocess` call: check for execution of untrusted input + scripts/hooks/install.py:5:5: S603 `subprocess` call: check for execution of untrusted input + scripts/hooks/protect_branches.py:10:22: S603 `subprocess` call: check for execution of untrusted input - scripts/hooks/protect_branches.py:10:26: S603 `subprocess` call: check for execution of untrusted input ... 69 additional changes omitted for rule S603 ... 68 additional changes omitted for project
demisto/content (+0 -8 violations, +0 -0 fixes)
ruff check --no-cache --exit-zero --ignore RUF9 --output-format concise --preview
- Packs/ANYRUN/Integrations/ANYRUN/ANYRUN.py:196:16: PLR1701 Merge `isinstance` calls: `isinstance(val, dict | list)` - Packs/AWS-GuardDuty/Integrations/AWSGuardDutyEventCollector/AWSGuardDutyEventCollector.py:33:12: PLR1701 Merge `isinstance` calls: `isinstance(obj, date | datetime)` - Packs/Base/Scripts/DBotMLFetchData/DBotMLFetchData.py:187:23: PLR1701 Merge `isinstance` calls: `isinstance(x, bool | str)` - Packs/Base/Scripts/DBotMLFetchData/DBotMLFetchData.py:192:37: PLR1701 Merge `isinstance` calls: `isinstance(v, bool | str)` - Packs/Base/Scripts/DBotTrainClustering/DBotTrainClustering.py:422:8: PLR1701 Merge `isinstance` calls: `isinstance(obj, list | str)` - Packs/BluecatAddressManager/Integrations/BluecatAddressManager/BluecatAddressManager.py:256:12: PLR1701 Merge `isinstance` calls - Packs/ExpanseV2/Scripts/ExpanseEvidenceDynamicSection/ExpanseEvidenceDynamicSection.py:15:8: PLR1701 Merge `isinstance` calls: `isinstance(v, float | int | str)` - Packs/TOPdesk/Integrations/TOPdesk/TOPdesk.py:577:16: PLR1701 Merge `isinstance` calls: `isinstance(value, bool | str)`
freedomofpress/securedrop (+2 -0 violations, +0 -0 fixes)
ruff check --no-cache --exit-zero --ignore RUF9 --output-format concise --preview
+ devops/scripts/verify-mo.py:116:16: S602 `subprocess` call with `shell=True` identified, security issue + devops/scripts/verify-mo.py:120:26: RUF100 [*] Unused `noqa` directive (unused: `S602`)
rotki/rotki (+3 -3 violations, +0 -0 fixes)
ruff check --no-cache --exit-zero --ignore RUF9 --output-format concise --preview
+ packaging/docker/entrypoint.py:144:11: S603 `subprocess` call: check for execution of untrusted input - packaging/docker/entrypoint.py:144:28: S603 `subprocess` call: check for execution of untrusted input - packaging/docker/entrypoint.py:166:26: S603 `subprocess` call: check for execution of untrusted input + packaging/docker/entrypoint.py:166:9: S603 `subprocess` call: check for execution of untrusted input - packaging/docker/entrypoint.py:174:52: S602 `subprocess` call with `shell=True` seems safe, but may be changed in the future; consider rewriting without `shell` + packaging/docker/entrypoint.py:174:9: S602 `subprocess` call with `shell=True` seems safe, but may be changed in the future; consider rewriting without `shell`
zulip/zulip (+37 -37 violations, +0 -0 fixes)
ruff check --no-cache --exit-zero --ignore RUF9 --output-format concise --preview --select ALL
+ scripts/lib/check_rabbitmq_queue.py:143:26: S603 `subprocess` call: check for execution of untrusted input - scripts/lib/check_rabbitmq_queue.py:144:9: S603 `subprocess` call: check for execution of untrusted input + scripts/lib/check_rabbitmq_queue.py:160:23: S603 `subprocess` call: check for execution of untrusted input - scripts/lib/check_rabbitmq_queue.py:161:9: S603 `subprocess` call: check for execution of untrusted input + scripts/lib/hash_reqs.py:38:12: S603 `subprocess` call: check for execution of untrusted input - scripts/lib/hash_reqs.py:38:36: S603 `subprocess` call: check for execution of untrusted input + scripts/lib/puppet_cache.py:25:30: S603 `subprocess` call: check for execution of untrusted input - scripts/lib/puppet_cache.py:27:9: S603 `subprocess` call: check for execution of untrusted input + scripts/lib/setup_venv.py:179:31: S603 `subprocess` call: check for execution of untrusted input - scripts/lib/setup_venv.py:179:55: S603 `subprocess` call: check for execution of untrusted input ... 64 additional changes omitted for project
Changes by rule (6 rules affected)
code | total | + violation | - violation | + fix | - fix |
---|---|---|---|---|---|
S603 | 454 | 227 | 227 | 0 | 0 |
S602 | 21 | 11 | 10 | 0 | 0 |
S604 | 16 | 8 | 8 | 0 | 0 |
PLR1701 | 11 | 0 | 11 | 0 | 0 |
S605 | 8 | 4 | 4 | 0 | 0 |
RUF100 | 1 | 1 | 0 | 0 | 0 |
Formatter (stable)
✅ ecosystem check detected no format changes.
Formatter (preview)
✅ ecosystem check detected no format changes.
…e checked for deprecation (#12037)
…e checked for deprecation (#12037)
Summary
Small refactor that uses Rust's destructuring to enforce that all top-level lint options are checked for deprecation.
This should also make it less likely that new options are added to the
LintCommonOptions
struct, because it would feel strange to add a deprecation message for a just newly introduced option.Test Plan
cargo build