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:
3737 rev : 25.1.0
3838 hooks :
3939 - id : black
40+ - repo : https://github.com/tonybaloney/perflint
41+ rev : 0.8.1
42+ hooks :
43+ - id : perflint
4044 - repo : https://github.com/adamchainz/blacken-docs
4145 rev : " 1.19.1"
4246 hooks :
Original file line number Diff line number Diff line change @@ -62,8 +62,8 @@ Performance measurements
6262------------------------
6363
6464Once 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.
6767
6868.. seealso ::
6969 * `airspeed velocity (asv) <https://asv.readthedocs.io/en/stable/ >`_
Original file line number Diff line number Diff line change @@ -6,7 +6,49 @@ perflint
66========
77
88`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+ -----
1052
1153W8101: ``unnecessary-list-cast ``
1254 Unnecessary use of ``list() `` on an already iterable type.
You can’t perform that action at this time.
0 commit comments