-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Avoid displaying syntax error as log message #11902
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
Conversation
58fb82b to
72b9853
Compare
085e9a4 to
9bc3076
Compare
|
| code | total | + violation | - violation | + fix | - fix |
|---|---|---|---|---|---|
| ANN101 | 35381 | 0 | 35381 | 0 | 0 |
| ANN102 | 674 | 0 | 674 | 0 | 0 |
| S603 | 454 | 227 | 227 | 0 | 0 |
| E721 | 211 | 188 | 23 | 0 | 0 |
| S610 | 22 | 22 | 0 | 0 | 0 |
| S602 | 21 | 11 | 10 | 0 | 0 |
| S604 | 16 | 8 | 8 | 0 | 0 |
| S605 | 8 | 4 | 4 | 0 | 0 |
| F811 | 8 | 8 | 0 | 0 | 0 |
| PLR1701 | 3 | 0 | 3 | 0 | 0 |
| D107 | 2 | 1 | 1 | 0 | 0 |
| RUF100 | 2 | 2 | 0 | 0 | 0 |
| NPY201 | 1 | 1 | 0 | 0 | 0 |
| RUF024 | 1 | 1 | 0 | 0 | 0 |
Linter (preview)
ℹ️ ecosystem check detected linter changes. (+261 -256 violations, +0 -0 fixes in 12 projects; 1 project error; 37 projects unchanged)
PlasmaPy/PlasmaPy (+1 -0 violations, +0 -0 fixes)
ruff check --no-cache --exit-zero --ignore RUF9 --output-format concise --preview
+ src/plasmapy/diagnostics/langmuir.py:1396:23: NPY201 `np.trapz` will be removed in NumPy 2.0. Use `numpy.trapezoid` on NumPy 2.0, or ignore this warning on earlier versions.
apache/airflow (+171 -177 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 ... 297 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))` - airflow/www/extensions/init_appbuilder.py:1:1: CPY001 Missing copyright notice at top of file - airflow/www/fab_security/manager.py:1:1: CPY001 Missing copyright notice at top of file + 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 ... 11 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 ... 11 additional changes omitted for rule S602 + 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` ... 3 additional changes omitted for rule S605 - tests/providers/elasticsearch/log/elasticmock/fake_elasticsearch.py:1:1: CPY001 Missing copyright notice at top of file ... 318 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
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`)
fronzbot/blinkpy (+2 -0 violations, +0 -0 fixes)
ruff check --no-cache --exit-zero --ignore RUF9 --output-format concise --preview
+ blinksync/blinksync.py:58:53: F811 Redefinition of unused `working` from line 55 + blinksync/blinksync.py:81:53: F811 Redefinition of unused `working` from line 78
ibis-project/ibis (+3 -0 violations, +0 -0 fixes)
ruff check --no-cache --exit-zero --ignore RUF9 --output-format concise --preview
+ ibis/expr/types/strings.py:1678:9: F811 Redefinition of unused `__mul__` from line 638 + ibis/expr/types/strings.py:417:9: F811 Redefinition of unused `initcap` from line 412 + ibis/tests/benchmarks/test_benchmarks.py:720:34: F811 Redefinition of unused `con` from line 705
prefecthq/prefect (+1 -0 violations, +0 -0 fixes)
ruff check --no-cache --exit-zero --ignore RUF9 --output-format concise --preview
+ src/prefect/cli/cloud/__init__.py:269:42: F811 Redefinition of unused `timeout_scope` from line 244
rotki/rotki (+4 -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` + rotkehlchen/tests/exchanges/test_kraken.py:654:58: F811 Redefinition of unused `cursor` from line 653
zulip/zulip (+37 -38 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 ... 69 additional changes omitted for rule S603 - zerver/lib/markdown/fenced_code.py:1:1: CPY001 Missing copyright notice at top of file ... 68 additional changes omitted for project
agronholm/anyio (+1 -0 violations, +0 -0 fixes)
ruff check --no-cache --exit-zero --ignore RUF9 --output-format concise --preview
+ tests/test_taskgroups.py:557:27: RUF100 [*] Unused `noqa` directive (unknown: `ASYNC101`)
python-trio/trio (+0 -0 violations, +0 -0 fixes)
ruff check --no-cache --exit-zero --ignore RUF9 --output-format concise --preview
encode/httpx (+1 -0 violations, +0 -0 fixes)
ruff check --no-cache --exit-zero --ignore RUF9 --output-format concise --preview
+ tests/client/test_auth.py:371:73: F811 Redefinition of unused `client` from line 366
demisto/content (error)
ruff check --no-cache --exit-zero --ignore RUF9 --output-format concise --preview
ruff failed
Cause: Failed to parse /home/runner/work/ruff/ruff/checkouts/demisto:content/pyproject.toml
Cause: TOML parse error at line 92, column 1
|
92 | [tool.ruff]
| ^^^^^^^^^^^
Unknown rule selector: `E999`
Changes by rule (9 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 |
| S605 | 8 | 4 | 4 | 0 | 0 |
| F811 | 8 | 8 | 0 | 0 | 0 |
| CPY001 | 4 | 0 | 4 | 0 | 0 |
| PLR1701 | 3 | 0 | 3 | 0 | 0 |
| RUF100 | 2 | 2 | 0 | 0 | 0 |
| NPY201 | 1 | 1 | 0 | 0 | 0 |
1121283 to
80326bd
Compare
9bc3076 to
c54a6c1
Compare
80326bd to
057bd52
Compare
057bd52 to
955fdb7
Compare
aead4a1 to
119f7a5
Compare
c54a6c1 to
c531897
Compare
119f7a5 to
9ff212c
Compare
c531897 to
7591502
Compare
7ef78bd to
02b5c55
Compare
7591502 to
0fe0d6d
Compare
## Summary Follow-up to #11902 This PR simplifies the `LinterResult` struct by avoiding the generic and not store the `ParseError`. This is possible because the callers already have access to the `ParseError` via the `Parsed` output. This also means that we can simplify the return type of `check_path` and avoid the generic `T` on `LinterResult`. ## Test Plan `cargo insta test`
CodSpeed Performance ReportMerging #11902 will degrade performances by 4.03%Comparing Summary
Benchmarks breakdown
|
## Summary Follow-up to #11901 This PR avoids displaying the syntax errors as log message now that the `E999` diagnostic cannot be disabled. For context on why this was added, refer to #2505. Basically, we would allow ignoring the syntax error diagnostic because certain syntax feature weren't supported back then like `match` statement. And, if a user ignored `E999`, Ruff would give no feedback if the source code contained any syntax error. So, this log message was a way to indicate to the user even if `E999` was disabled. The current state of the parser is such that (a) it matches with the latest grammar and (b) it's easy to add support for any new syntax. **Note:** This PR doesn't remove the `DisplayParseError` struct because it's still being used by the formatter. ## Test Plan Update existing snapshots from the integration tests.
## Summary Follow-up to #11902 This PR simplifies the `LinterResult` struct by avoiding the generic and not store the `ParseError`. This is possible because the callers already have access to the `ParseError` via the `Parsed` output. This also means that we can simplify the return type of `check_path` and avoid the generic `T` on `LinterResult`. ## Test Plan `cargo insta test`
## Summary Follow-up to #11902 This PR simplifies the `LinterResult` struct by avoiding the generic and not store the `ParseError`. This is possible because the callers already have access to the `ParseError` via the `Parsed` output. This also means that we can simplify the return type of `check_path` and avoid the generic `T` on `LinterResult`. ## Test Plan `cargo insta test`
## Summary Follow-up to #11901 This PR avoids displaying the syntax errors as log message now that the `E999` diagnostic cannot be disabled. For context on why this was added, refer to #2505. Basically, we would allow ignoring the syntax error diagnostic because certain syntax feature weren't supported back then like `match` statement. And, if a user ignored `E999`, Ruff would give no feedback if the source code contained any syntax error. So, this log message was a way to indicate to the user even if `E999` was disabled. The current state of the parser is such that (a) it matches with the latest grammar and (b) it's easy to add support for any new syntax. **Note:** This PR doesn't remove the `DisplayParseError` struct because it's still being used by the formatter. ## Test Plan Update existing snapshots from the integration tests.
## Summary Follow-up to #11902 This PR simplifies the `LinterResult` struct by avoiding the generic and not store the `ParseError`. This is possible because the callers already have access to the `ParseError` via the `Parsed` output. This also means that we can simplify the return type of `check_path` and avoid the generic `T` on `LinterResult`. ## Test Plan `cargo insta test`
## Summary Follow-up to #11901 This PR avoids displaying the syntax errors as log message now that the `E999` diagnostic cannot be disabled. For context on why this was added, refer to #2505. Basically, we would allow ignoring the syntax error diagnostic because certain syntax feature weren't supported back then like `match` statement. And, if a user ignored `E999`, Ruff would give no feedback if the source code contained any syntax error. So, this log message was a way to indicate to the user even if `E999` was disabled. The current state of the parser is such that (a) it matches with the latest grammar and (b) it's easy to add support for any new syntax. **Note:** This PR doesn't remove the `DisplayParseError` struct because it's still being used by the formatter. ## Test Plan Update existing snapshots from the integration tests.
## Summary Follow-up to #11902 This PR simplifies the `LinterResult` struct by avoiding the generic and not store the `ParseError`. This is possible because the callers already have access to the `ParseError` via the `Parsed` output. This also means that we can simplify the return type of `check_path` and avoid the generic `T` on `LinterResult`. ## Test Plan `cargo insta test`
Summary
Follow-up to #11901
This PR avoids displaying the syntax errors as log message now that the
E999diagnostic cannot be disabled.For context on why this was added, refer to #2505. Basically, we would allow ignoring the syntax error diagnostic because certain syntax feature weren't supported back then like
matchstatement. And, if a user ignoredE999, Ruff would give no feedback if the source code contained any syntax error. So, this log message was a way to indicate to the user even ifE999was disabled.The current state of the parser is such that (a) it matches with the latest grammar and (b) it's easy to add support for any new syntax.
Note: This PR doesn't remove the
DisplayParseErrorstruct because it's still being used by the formatter.Test Plan
Update existing snapshots from the integration tests.