Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
72 changes: 36 additions & 36 deletions crates/ty/tests/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ fn config_override_python_version() -> anyhow::Result<()> {
5 | print(sys.last_exc)
| ^^^^^^^^^^^^
|
info: `unresolved-attribute` is enabled by default
info: rule `unresolved-attribute` is enabled by default

Found 1 diagnostic

Expand Down Expand Up @@ -296,7 +296,7 @@ fn cli_arguments_are_relative_to_the_current_directory() -> anyhow::Result<()> {
3 |
4 | stat = add(10, 15)
|
info: `unresolved-import` is enabled by default
info: rule `unresolved-import` is enabled by default

Found 1 diagnostic

Expand Down Expand Up @@ -400,7 +400,7 @@ fn configuration_rule_severity() -> anyhow::Result<()> {
3 |
4 | for a in range(0, int(y)):
|
info: `division-by-zero` is enabled by default
info: rule `division-by-zero` is enabled by default

error[unresolved-reference]: Name `prin` used when not defined
--> test.py:7:1
Expand All @@ -410,7 +410,7 @@ fn configuration_rule_severity() -> anyhow::Result<()> {
7 | prin(x) # unresolved-reference
| ^^^^
|
info: `unresolved-reference` is enabled by default
info: rule `unresolved-reference` is enabled by default

Found 2 diagnostics

Expand Down Expand Up @@ -439,7 +439,7 @@ fn configuration_rule_severity() -> anyhow::Result<()> {
3 |
4 | for a in range(0, int(y)):
|
info: `division-by-zero` was selected in the configuration file
info: rule `division-by-zero` was selected in the configuration file

Found 1 diagnostic

Expand Down Expand Up @@ -481,7 +481,7 @@ fn cli_rule_severity() -> anyhow::Result<()> {
3 |
4 | y = 4 / 0
|
info: `unresolved-import` is enabled by default
info: rule `unresolved-import` is enabled by default

error[division-by-zero]: Cannot divide object of type `Literal[4]` by zero
--> test.py:4:5
Expand All @@ -493,7 +493,7 @@ fn cli_rule_severity() -> anyhow::Result<()> {
5 |
6 | for a in range(0, int(y)):
|
info: `division-by-zero` is enabled by default
info: rule `division-by-zero` is enabled by default

error[unresolved-reference]: Name `prin` used when not defined
--> test.py:9:1
Expand All @@ -503,7 +503,7 @@ fn cli_rule_severity() -> anyhow::Result<()> {
9 | prin(x) # unresolved-reference
| ^^^^
|
info: `unresolved-reference` is enabled by default
info: rule `unresolved-reference` is enabled by default

Found 3 diagnostics

Expand Down Expand Up @@ -532,7 +532,7 @@ fn cli_rule_severity() -> anyhow::Result<()> {
3 |
4 | y = 4 / 0
|
info: `unresolved-import` was selected on the command line
info: rule `unresolved-import` was selected on the command line

warning[division-by-zero]: Cannot divide object of type `Literal[4]` by zero
--> test.py:4:5
Expand All @@ -544,7 +544,7 @@ fn cli_rule_severity() -> anyhow::Result<()> {
5 |
6 | for a in range(0, int(y)):
|
info: `division-by-zero` was selected on the command line
info: rule `division-by-zero` was selected on the command line

Found 2 diagnostics

Expand Down Expand Up @@ -586,7 +586,7 @@ fn cli_rule_severity_precedence() -> anyhow::Result<()> {
3 |
4 | for a in range(0, int(y)):
|
info: `division-by-zero` is enabled by default
info: rule `division-by-zero` is enabled by default

error[unresolved-reference]: Name `prin` used when not defined
--> test.py:7:1
Expand All @@ -596,7 +596,7 @@ fn cli_rule_severity_precedence() -> anyhow::Result<()> {
7 | prin(x) # unresolved-reference
| ^^^^
|
info: `unresolved-reference` is enabled by default
info: rule `unresolved-reference` is enabled by default

Found 2 diagnostics

Expand Down Expand Up @@ -626,7 +626,7 @@ fn cli_rule_severity_precedence() -> anyhow::Result<()> {
3 |
4 | for a in range(0, int(y)):
|
info: `division-by-zero` was selected on the command line
info: rule `division-by-zero` was selected on the command line

Found 1 diagnostic

Expand Down Expand Up @@ -707,7 +707,7 @@ fn exit_code_only_warnings() -> anyhow::Result<()> {
1 | print(x) # [unresolved-reference]
| ^
|
info: `unresolved-reference` was selected on the command line
info: rule `unresolved-reference` was selected on the command line

Found 1 diagnostic

Expand Down Expand Up @@ -794,7 +794,7 @@ fn exit_code_no_errors_but_error_on_warning_is_true() -> anyhow::Result<()> {
1 | print(x) # [unresolved-reference]
| ^
|
info: `unresolved-reference` was selected on the command line
info: rule `unresolved-reference` was selected on the command line

Found 1 diagnostic

Expand Down Expand Up @@ -828,7 +828,7 @@ fn exit_code_no_errors_but_error_on_warning_is_enabled_in_configuration() -> any
1 | print(x) # [unresolved-reference]
| ^
|
info: `unresolved-reference` was selected on the command line
info: rule `unresolved-reference` was selected on the command line

Found 1 diagnostic

Expand Down Expand Up @@ -860,7 +860,7 @@ fn exit_code_both_warnings_and_errors() -> anyhow::Result<()> {
| ^
3 | print(4[1]) # [non-subscriptable]
|
info: `unresolved-reference` was selected on the command line
info: rule `unresolved-reference` was selected on the command line

error[non-subscriptable]: Cannot subscript object of type `Literal[4]` with no `__getitem__` method
--> test.py:3:7
Expand All @@ -869,7 +869,7 @@ fn exit_code_both_warnings_and_errors() -> anyhow::Result<()> {
3 | print(4[1]) # [non-subscriptable]
| ^
|
info: `non-subscriptable` is enabled by default
info: rule `non-subscriptable` is enabled by default

Found 2 diagnostics

Expand Down Expand Up @@ -901,7 +901,7 @@ fn exit_code_both_warnings_and_errors_and_error_on_warning_is_true() -> anyhow::
| ^
3 | print(4[1]) # [non-subscriptable]
|
info: `unresolved-reference` was selected on the command line
info: rule `unresolved-reference` was selected on the command line

error[non-subscriptable]: Cannot subscript object of type `Literal[4]` with no `__getitem__` method
--> test.py:3:7
Expand All @@ -910,7 +910,7 @@ fn exit_code_both_warnings_and_errors_and_error_on_warning_is_true() -> anyhow::
3 | print(4[1]) # [non-subscriptable]
| ^
|
info: `non-subscriptable` is enabled by default
info: rule `non-subscriptable` is enabled by default

Found 2 diagnostics

Expand Down Expand Up @@ -942,7 +942,7 @@ fn exit_code_exit_zero_is_true() -> anyhow::Result<()> {
| ^
3 | print(4[1]) # [non-subscriptable]
|
info: `unresolved-reference` was selected on the command line
info: rule `unresolved-reference` was selected on the command line

error[non-subscriptable]: Cannot subscript object of type `Literal[4]` with no `__getitem__` method
--> test.py:3:7
Expand All @@ -951,7 +951,7 @@ fn exit_code_exit_zero_is_true() -> anyhow::Result<()> {
3 | print(4[1]) # [non-subscriptable]
| ^
|
info: `non-subscriptable` is enabled by default
info: rule `non-subscriptable` is enabled by default

Found 2 diagnostics

Expand Down Expand Up @@ -1006,7 +1006,7 @@ fn user_configuration() -> anyhow::Result<()> {
3 |
4 | for a in range(0, int(y)):
|
info: `division-by-zero` was selected in the configuration file
info: rule `division-by-zero` was selected in the configuration file

error[unresolved-reference]: Name `prin` used when not defined
--> main.py:7:1
Expand All @@ -1016,7 +1016,7 @@ fn user_configuration() -> anyhow::Result<()> {
7 | prin(x)
| ^^^^
|
info: `unresolved-reference` is enabled by default
info: rule `unresolved-reference` is enabled by default

Found 2 diagnostics

Expand Down Expand Up @@ -1051,7 +1051,7 @@ fn user_configuration() -> anyhow::Result<()> {
3 |
4 | for a in range(0, int(y)):
|
info: `division-by-zero` was selected in the configuration file
info: rule `division-by-zero` was selected in the configuration file

warning[unresolved-reference]: Name `prin` used when not defined
--> main.py:7:1
Expand All @@ -1061,7 +1061,7 @@ fn user_configuration() -> anyhow::Result<()> {
7 | prin(x)
| ^^^^
|
info: `unresolved-reference` was selected in the configuration file
info: rule `unresolved-reference` was selected in the configuration file

Found 2 diagnostics

Expand Down Expand Up @@ -1110,7 +1110,7 @@ fn check_specific_paths() -> anyhow::Result<()> {
2 | y = 4 / 0 # error: division-by-zero
| ^^^^^
|
info: `division-by-zero` is enabled by default
info: rule `division-by-zero` is enabled by default

error[unresolved-import]: Cannot resolve imported module `main2`
--> project/other.py:2:6
Expand All @@ -1120,15 +1120,15 @@ fn check_specific_paths() -> anyhow::Result<()> {
3 |
4 | print(z)
|
info: `unresolved-import` is enabled by default
info: rule `unresolved-import` is enabled by default

error[unresolved-import]: Cannot resolve imported module `does_not_exist`
--> project/tests/test_main.py:2:8
|
2 | import does_not_exist # error: unresolved-import
| ^^^^^^^^^^^^^^
|
info: `unresolved-import` is enabled by default
info: rule `unresolved-import` is enabled by default

Found 3 diagnostics

Expand All @@ -1153,15 +1153,15 @@ fn check_specific_paths() -> anyhow::Result<()> {
3 |
4 | print(z)
|
info: `unresolved-import` is enabled by default
info: rule `unresolved-import` is enabled by default

error[unresolved-import]: Cannot resolve imported module `does_not_exist`
--> project/tests/test_main.py:2:8
|
2 | import does_not_exist # error: unresolved-import
| ^^^^^^^^^^^^^^
|
info: `unresolved-import` is enabled by default
info: rule `unresolved-import` is enabled by default

Found 2 diagnostics

Expand Down Expand Up @@ -1337,7 +1337,7 @@ fn defaults_to_a_new_python_version() -> anyhow::Result<()> {
4 | os.grantpt(1) # only available on unix, Python 3.13 or newer
| ^^^^^^^^^^
|
info: `unresolved-attribute` is enabled by default
info: rule `unresolved-attribute` is enabled by default

Found 1 diagnostic

Expand Down Expand Up @@ -1392,7 +1392,7 @@ fn cli_config_args_toml_string_basic() -> anyhow::Result<()> {
1 | print(x) # [unresolved-reference]
| ^
|
info: `unresolved-reference` was selected on the command line
info: rule `unresolved-reference` was selected on the command line

Found 1 diagnostic

Expand All @@ -1411,7 +1411,7 @@ fn cli_config_args_toml_string_basic() -> anyhow::Result<()> {
1 | print(x) # [unresolved-reference]
| ^
|
info: `unresolved-reference` is enabled by default
info: rule `unresolved-reference` is enabled by default

Found 1 diagnostic

Expand Down Expand Up @@ -1444,7 +1444,7 @@ fn cli_config_args_overrides_knot_toml() -> anyhow::Result<()> {
1 | print(x) # [unresolved-reference]
| ^
|
info: `unresolved-reference` was selected on the command line
info: rule `unresolved-reference` was selected on the command line

Found 1 diagnostic

Expand All @@ -1468,7 +1468,7 @@ fn cli_config_args_later_overrides_earlier() -> anyhow::Result<()> {
1 | print(x) # [unresolved-reference]
| ^
|
info: `unresolved-reference` was selected on the command line
info: rule `unresolved-reference` was selected on the command line

Found 1 diagnostic

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,6 @@ error[invalid-assignment]: Invalid assignment to data descriptor attribute `attr
11 | instance.attr = 1 # error: [invalid-assignment]
| ^^^^^^^^^^^^^
|
info: `invalid-assignment` is enabled by default
info: rule `invalid-assignment` is enabled by default

```
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,6 @@ error[invalid-assignment]: Invalid assignment to data descriptor attribute `attr
12 | instance.attr = "wrong" # error: [invalid-assignment]
| ^^^^^^^^^^^^^
|
info: `invalid-assignment` is enabled by default
info: rule `invalid-assignment` is enabled by default

```
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ error[invalid-assignment]: Object of type `Literal["wrong"]` is not assignable t
7 |
8 | C.attr = 1 # fine
|
info: `invalid-assignment` is enabled by default
info: rule `invalid-assignment` is enabled by default

```

Expand All @@ -48,6 +48,6 @@ error[invalid-assignment]: Object of type `Literal["wrong"]` is not assignable t
9 | C.attr = "wrong" # error: [invalid-assignment]
| ^^^^^^
|
info: `invalid-assignment` is enabled by default
info: rule `invalid-assignment` is enabled by default

```
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ warning[possibly-unbound-attribute]: Attribute `attr` on type `<class 'C'>` is p
7 |
8 | instance = C()
|
info: `possibly-unbound-attribute` is enabled by default
info: rule `possibly-unbound-attribute` is enabled by default

```

Expand All @@ -48,6 +48,6 @@ warning[possibly-unbound-attribute]: Attribute `attr` on type `C` is possibly un
9 | instance.attr = 1 # error: [possibly-unbound-attribute]
| ^^^^^^^^^^^^^
|
info: `possibly-unbound-attribute` is enabled by default
info: rule `possibly-unbound-attribute` is enabled by default

```
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ error[invalid-assignment]: Object of type `Literal["wrong"]` is not assignable t
8 |
9 | C.attr = 1 # error: [invalid-attribute-access]
|
info: `invalid-assignment` is enabled by default
info: rule `invalid-assignment` is enabled by default

```

Expand All @@ -49,6 +49,6 @@ error[invalid-attribute-access]: Cannot assign to instance attribute `attr` from
9 | C.attr = 1 # error: [invalid-attribute-access]
| ^^^^^^
|
info: `invalid-attribute-access` is enabled by default
info: rule `invalid-attribute-access` is enabled by default

```
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,6 @@ error[invalid-assignment]: Object of type `Literal[1]` is not assignable to attr
12 |
13 | class C2:
|
info: `invalid-assignment` is enabled by default
info: rule `invalid-assignment` is enabled by default

```
Loading
Loading