File tree Expand file tree Collapse file tree 3 files changed +49
-3
lines changed Expand file tree Collapse file tree 3 files changed +49
-3
lines changed Original file line number Diff line number Diff line change @@ -37,6 +37,10 @@ repos:
37
37
rev : 25.1.0
38
38
hooks :
39
39
- id : black
40
+ - repo : https://github.com/tonybaloney/perflint
41
+ rev : 0.8.1
42
+ hooks :
43
+ - id : perflint
40
44
- repo : https://github.com/adamchainz/blacken-docs
41
45
rev : " 1.19.1"
42
46
hooks :
Original file line number Diff line number Diff line change @@ -62,8 +62,8 @@ Performance measurements
62
62
------------------------
63
63
64
64
Once you have worked with your code, it can be useful to examine its efficiency
65
- more closely. The :doc: `ipython-profiler ` or :doc: `scalene ` can be used for
66
- this.
65
+ more closely. :mod: ` cProfile `, :doc: `ipython-profiler ` or :doc: `scalene ` can be
66
+ used for this.
67
67
68
68
.. seealso ::
69
69
* `airspeed velocity (asv) <https://asv.readthedocs.io/en/stable/ >`_
Original file line number Diff line number Diff line change @@ -6,7 +6,49 @@ perflint
6
6
========
7
7
8
8
`perflint <https://github.com/tonybaloney/perflint >`_ is an extension for
9
- `pylint <https://pylint.org/ >`_ for performance anti-patterns, among others:
9
+ `pylint <https://pylint.org/ >`_ for performance anti-patterns.
10
+
11
+ Installation
12
+ ------------
13
+
14
+ .. code-block :: console
15
+
16
+ $ uv add --dev perflint
17
+
18
+ Use
19
+ ---
20
+
21
+ … as an independent linter
22
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~
23
+
24
+ .. code-block :: console
25
+
26
+ $ uv run perflint src/
27
+
28
+ … as ``pylint `` plugin
29
+ ~~~~~~~~~~~~~~~~~~~~~~
30
+
31
+ .. code-block :: console
32
+
33
+ $ uv run perflint src/ --load-plugins=perflint
34
+
35
+ … as pre-commit hook
36
+ ~~~~~~~~~~~~~~~~~x~~~
37
+
38
+ perflint can also be used with the
39
+ :doc: `/productive/git/advanced/hooks/pre-commit `:
40
+
41
+ .. code-block :: yaml
42
+ :caption : .pre-commit-config.yaml
43
+
44
+ repos :
45
+ - repo : https://github.com/tonybaloney/perflint
46
+ rev : 0.8.1
47
+ hooks :
48
+ - id : perflint
49
+
50
+ Rules
51
+ -----
10
52
11
53
W8101: ``unnecessary-list-cast ``
12
54
Unnecessary use of ``list() `` on an already iterable type.
You can’t perform that action at this time.
0 commit comments