-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7a3c637
commit 596bf41
Showing
9 changed files
with
165 additions
and
108 deletions.
There are no files selected for viewing
This file contains 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
4 changes: 4 additions & 0 deletions
4
crates/ruff_linter/resources/test/fixtures/darglint/DAR401_numpy.py
This file contains 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
4 changes: 4 additions & 0 deletions
4
crates/ruff_linter/resources/test/fixtures/darglint/DAR402_google.py
This file contains 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
4 changes: 4 additions & 0 deletions
4
crates/ruff_linter/resources/test/fixtures/darglint/DAR402_numpy.py
This file contains 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
This file contains 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
48 changes: 24 additions & 24 deletions
48
...ruff_linter__rules__darglint__tests__docstring-extraneous-exception_DAR402_google.py.snap
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,38 @@ | ||
--- | ||
source: crates/ruff_linter/src/rules/darglint/mod.rs | ||
--- | ||
DAR402_google.py:11:1: DAR402 FasterThanLightError not explicitly raised. | ||
DAR402_google.py:15:1: DAR402 FasterThanLightError not explicitly raised. | ||
| | ||
9 | Speed as distance divided by time. | ||
10 | | ||
11 | / Raises: | ||
12 | | FasterThanLightError: If speed is greater than the speed of light. | ||
13 | | """ | ||
13 | Speed as distance divided by time. | ||
14 | | ||
15 | / Raises: | ||
16 | | FasterThanLightError: If speed is greater than the speed of light. | ||
17 | | """ | ||
| |____^ DAR402 | ||
14 | return distance / time | ||
18 | return distance / time | ||
| | ||
|
||
DAR402_google.py:27:1: DAR402 FasterThanLightError, DivisionByZero not explicitly raised. | ||
DAR402_google.py:31:1: DAR402 FasterThanLightError, DivisionByZero not explicitly raised. | ||
| | ||
25 | Speed as distance divided by time. | ||
26 | | ||
27 | / Raises: | ||
28 | | FasterThanLightError: If speed is greater than the speed of light. | ||
29 | | DivisionByZero: Divide by zero. | ||
30 | | """ | ||
29 | Speed as distance divided by time. | ||
30 | | ||
31 | / Raises: | ||
32 | | FasterThanLightError: If speed is greater than the speed of light. | ||
33 | | DivisionByZero: Divide by zero. | ||
34 | | """ | ||
| |____^ DAR402 | ||
31 | return distance / time | ||
35 | return distance / time | ||
| | ||
|
||
DAR402_google.py:44:1: DAR402 DivisionByZero not explicitly raised. | ||
DAR402_google.py:48:1: DAR402 DivisionByZero not explicitly raised. | ||
| | ||
42 | Speed as distance divided by time. | ||
43 | | ||
44 | / Raises: | ||
45 | | FasterThanLightError: If speed is greater than the speed of light. | ||
46 | | DivisionByZero: Divide by zero. | ||
47 | | """ | ||
46 | Speed as distance divided by time. | ||
47 | | ||
48 | / Raises: | ||
49 | | FasterThanLightError: If speed is greater than the speed of light. | ||
50 | | DivisionByZero: Divide by zero. | ||
51 | | """ | ||
| |____^ DAR402 | ||
48 | try: | ||
49 | return distance / time | ||
52 | try: | ||
53 | return distance / time | ||
| |
64 changes: 32 additions & 32 deletions
64
.../ruff_linter__rules__darglint__tests__docstring-extraneous-exception_DAR402_numpy.py.snap
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,46 +1,46 @@ | ||
--- | ||
source: crates/ruff_linter/src/rules/darglint/mod.rs | ||
--- | ||
DAR402_numpy.py:17:1: DAR402 FasterThanLightError not explicitly raised. | ||
DAR402_numpy.py:21:1: DAR402 FasterThanLightError not explicitly raised. | ||
| | ||
15 | Speed as distance divided by time. | ||
16 | | ||
17 | / Raises | ||
18 | | ------ | ||
19 | | FasterThanLightError | ||
20 | | If speed is greater than the speed of light. | ||
21 | | """ | ||
19 | Speed as distance divided by time. | ||
20 | | ||
21 | / Raises | ||
22 | | ------ | ||
23 | | FasterThanLightError | ||
24 | | If speed is greater than the speed of light. | ||
25 | | """ | ||
| |____^ DAR402 | ||
22 | return distance / time | ||
26 | return distance / time | ||
| | ||
|
||
DAR402_numpy.py:41:1: DAR402 FasterThanLightError, DivisionByZero not explicitly raised. | ||
DAR402_numpy.py:45:1: DAR402 FasterThanLightError, DivisionByZero not explicitly raised. | ||
| | ||
39 | Speed as distance divided by time. | ||
40 | | ||
41 | / Raises | ||
42 | | ------ | ||
43 | | FasterThanLightError | ||
44 | | If speed is greater than the speed of light. | ||
45 | | DivisionByZero | ||
46 | | If attempting to divide by zero. | ||
47 | | """ | ||
43 | Speed as distance divided by time. | ||
44 | | ||
45 | / Raises | ||
46 | | ------ | ||
47 | | FasterThanLightError | ||
48 | | If speed is greater than the speed of light. | ||
49 | | DivisionByZero | ||
50 | | If attempting to divide by zero. | ||
51 | | """ | ||
| |____^ DAR402 | ||
48 | return distance / time | ||
52 | return distance / time | ||
| | ||
|
||
DAR402_numpy.py:67:1: DAR402 DivisionByZero not explicitly raised. | ||
DAR402_numpy.py:71:1: DAR402 DivisionByZero not explicitly raised. | ||
| | ||
65 | Speed as distance divided by time. | ||
66 | | ||
67 | / Raises | ||
68 | | ------ | ||
69 | | FasterThanLightError | ||
70 | | If speed is greater than the speed of light. | ||
71 | | DivisionByZero | ||
72 | | If attempting to divide by zero. | ||
73 | | """ | ||
69 | Speed as distance divided by time. | ||
70 | | ||
71 | / Raises | ||
72 | | ------ | ||
73 | | FasterThanLightError | ||
74 | | If speed is greater than the speed of light. | ||
75 | | DivisionByZero | ||
76 | | If attempting to divide by zero. | ||
77 | | """ | ||
| |____^ DAR402 | ||
74 | try: | ||
75 | return distance / time | ||
78 | try: | ||
79 | return distance / time | ||
| |
36 changes: 22 additions & 14 deletions
36
...ts/ruff_linter__rules__darglint__tests__docstring-missing-exception_DAR401_google.py.snap
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,36 @@ | ||
--- | ||
source: crates/ruff_linter/src/rules/darglint/mod.rs | ||
--- | ||
DAR401_google.py:35:15: DAR401 Raised exception `FasterThanLightError` missing from docstring | ||
DAR401_google.py:45:15: DAR401 Raised exception `FasterThanLightError` missing from docstring | ||
| | ||
33 | return distance / time | ||
34 | except ZeroDivisionError as exc: | ||
35 | raise FasterThanLightError from exc | ||
43 | return distance / time | ||
44 | except ZeroDivisionError as exc: | ||
45 | raise FasterThanLightError from exc | ||
| ^^^^^^^^^^^^^^^^^^^^ DAR401 | ||
| | ||
|
||
DAR401_google.py:52:15: DAR401 Raised exception `FasterThanLightError` missing from docstring | ||
DAR401_google.py:62:15: DAR401 Raised exception `FasterThanLightError` missing from docstring | ||
| | ||
50 | return distance / time | ||
51 | except ZeroDivisionError as exc: | ||
52 | raise FasterThanLightError from exc | ||
60 | return distance / time | ||
61 | except ZeroDivisionError as exc: | ||
62 | raise FasterThanLightError from exc | ||
| ^^^^^^^^^^^^^^^^^^^^ DAR401 | ||
53 | except: | ||
54 | raise ValueError | ||
63 | except: | ||
64 | raise ValueError | ||
| | ||
|
||
DAR401_google.py:54:15: DAR401 Raised exception `ValueError` missing from docstring | ||
DAR401_google.py:64:15: DAR401 Raised exception `ValueError` missing from docstring | ||
| | ||
52 | raise FasterThanLightError from exc | ||
53 | except: | ||
54 | raise ValueError | ||
62 | raise FasterThanLightError from exc | ||
63 | except: | ||
64 | raise ValueError | ||
| ^^^^^^^^^^ DAR401 | ||
| | ||
|
||
DAR401_google.py:114:11: DAR401 Raised exception `AnotherError` missing from docstring | ||
| | ||
112 | Speed as distance divided by time. | ||
113 | """ | ||
114 | raise AnotherError | ||
| ^^^^^^^^^^^^ DAR401 | ||
| |
28 changes: 14 additions & 14 deletions
28
...ots/ruff_linter__rules__darglint__tests__docstring-missing-exception_DAR401_numpy.py.snap
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,28 @@ | ||
--- | ||
source: crates/ruff_linter/src/rules/darglint/mod.rs | ||
--- | ||
DAR401_numpy.py:47:15: DAR401 Raised exception `FasterThanLightError` missing from docstring | ||
DAR401_numpy.py:51:15: DAR401 Raised exception `FasterThanLightError` missing from docstring | ||
| | ||
45 | return distance / time | ||
46 | except ZeroDivisionError as exc: | ||
47 | raise FasterThanLightError from exc | ||
49 | return distance / time | ||
50 | except ZeroDivisionError as exc: | ||
51 | raise FasterThanLightError from exc | ||
| ^^^^^^^^^^^^^^^^^^^^ DAR401 | ||
| | ||
|
||
DAR401_numpy.py:69:15: DAR401 Raised exception `FasterThanLightError` missing from docstring | ||
DAR401_numpy.py:73:15: DAR401 Raised exception `FasterThanLightError` missing from docstring | ||
| | ||
67 | return distance / time | ||
68 | except ZeroDivisionError as exc: | ||
69 | raise FasterThanLightError from exc | ||
71 | return distance / time | ||
72 | except ZeroDivisionError as exc: | ||
73 | raise FasterThanLightError from exc | ||
| ^^^^^^^^^^^^^^^^^^^^ DAR401 | ||
70 | except: | ||
71 | raise ValueError | ||
74 | except: | ||
75 | raise ValueError | ||
| | ||
|
||
DAR401_numpy.py:71:15: DAR401 Raised exception `ValueError` missing from docstring | ||
DAR401_numpy.py:75:15: DAR401 Raised exception `ValueError` missing from docstring | ||
| | ||
69 | raise FasterThanLightError from exc | ||
70 | except: | ||
71 | raise ValueError | ||
73 | raise FasterThanLightError from exc | ||
74 | except: | ||
75 | raise ValueError | ||
| ^^^^^^^^^^ DAR401 | ||
| |