Skip to content

[red-knot] Separate invalid syntax code snippets#14803

Merged
dhruvmanila merged 1 commit intomainfrom
dhruv/separate-code-snippets
Dec 6, 2024
Merged

[red-knot] Separate invalid syntax code snippets#14803
dhruvmanila merged 1 commit intomainfrom
dhruv/separate-code-snippets

Conversation

@dhruvmanila
Copy link
Member

Ref: #14788 (comment)

This PR:

  • Separates code snippets as individual tests for the invalid syntax cases
  • Adds a general comment explaining why the parser could emit more syntax errors than expected

@dhruvmanila dhruvmanila added the ty Multi-file analysis & type inference label Dec 6, 2024
@dhruvmanila dhruvmanila enabled auto-merge (squash) December 6, 2024 02:37
@dhruvmanila dhruvmanila merged commit 40b0b67 into main Dec 6, 2024
@dhruvmanila dhruvmanila deleted the dhruv/separate-code-snippets branch December 6, 2024 02:41
@github-actions
Copy link
Contributor

github-actions bot commented Dec 6, 2024

ruff-ecosystem results

Linter (stable)

✅ ecosystem check detected no linter changes.

Linter (preview)

ℹ️ ecosystem check detected linter changes. (+1 -8 violations, +0 -0 fixes in 1 projects; 54 projects unchanged)

pandas-dev/pandas (+1 -8 violations, +0 -0 fixes)

ruff check --no-cache --exit-zero --ignore RUF9 --output-format concise --preview

+ pandas/core/algorithms.py:1696:1: E305 Expected 2 blank lines after class or function definition, found (0)
- pandas/core/algorithms.py:27:5: TC001 Move application import `pandas._typing.AnyArrayLike` into a type-checking block
- pandas/core/algorithms.py:28:5: TC001 Move application import `pandas._typing.ArrayLike` into a type-checking block
- pandas/core/algorithms.py:29:5: TC001 Move application import `pandas._typing.ArrayLikeT` into a type-checking block
- pandas/core/algorithms.py:30:5: TC001 Move application import `pandas._typing.AxisInt` into a type-checking block
- pandas/core/algorithms.py:31:5: TC001 Move application import `pandas._typing.DtypeObj` into a type-checking block
- pandas/core/algorithms.py:32:5: TC001 Move application import `pandas._typing.TakeIndexer` into a type-checking block
- pandas/core/algorithms.py:33:5: TC001 Move application import `pandas._typing.npt` into a type-checking block
- pandas/core/algorithms.py:916:9: PLR6104 Use `/=` to perform an augmented assignment directly

Changes by rule (3 rules affected)

code total + violation - violation + fix - fix
TC001 7 0 7 0 0
E305 1 1 0 0 0
PLR6104 1 0 1 0 0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ty Multi-file analysis & type inference

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant