Context
The build process already contains configuration for ESLint (to check Typescript/JavaScript) and Stylelint for (S)CSS. It might be a good idea to also run a linter across the Python code.
Description
I propose that we start running Pylint on the Python code in Material for MkDocs. In order to make this step easier, I also suggest that we initially turn off most of the rules that are mainly stylistic such as ordering of imports or are about documentation (docstrings). Specifically, turn off these:
missing-class-docstring
missing-function-docstring
missing-module-docstring
multiple-statements # in one line
unused-argument
unused-import
wrong-import-order
Once the other rules are satisfied, we can always revisit the ones that are initially turned off. Improving bit by bit seems the right approach to me. This avoids overwhelming us.
The change would involve adding Pylint as a dev dependency to pyproject.toml, then a new run script to package.json and, finally, a .pylintrc in the project root. Because adding these will add a checker to the build pipeline, the existing code would need to be cleaned up at the same time as these elements are being added. We are talking about ca. 100 lines that would be affected, see below. Let's discuss...
Pylint log
```
$ pylint src
************* Module src.extensions.emoji
src/extensions/emoji.py:44:0: R0913: Too many arguments (9/5) (too-many-arguments)
************* Module src.plugins.search.plugin
src/plugins/search/plugin.py:91:16: W1203: Use lazy % formatting in logging functions (logging-fstring-interpolation)
src/plugins/search/plugin.py:93:16: W1203: Use lazy % formatting in logging functions (logging-fstring-interpolation)
src/plugins/search/plugin.py:103:16: W1203: Use lazy % formatting in logging functions (logging-fstring-interpolation)
src/plugins/search/plugin.py:105:16: W1203: Use lazy % formatting in logging functions (logging-fstring-interpolation)
src/plugins/search/plugin.py:84:8: W0201: Attribute 'search_index' defined outside init (attribute-defined-outside-init)
src/plugins/search/plugin.py:273:35: W0622: Redefining built-in 'id' (redefined-builtin)
src/plugins/search/plugin.py:315:4: W0102: Dangerous default value {} as argument (dangerous-default-value)
src/plugins/search/plugin.py:325:8: R1705: Unnecessary "else" after "return", remove the "else" and de-indent the code inside it (no-else-return)
src/plugins/search/plugin.py:359:8: R1705: Unnecessary "else" after "return", remove the "else" and de-indent the code inside it (no-else-return)
src/plugins/search/plugin.py:406:4: R0912: Too many branches (13/12) (too-many-branches)
src/plugins/search/plugin.py:465:4: R0912: Too many branches (14/12) (too-many-branches)
src/plugins/search/plugin.py:521:11: C0117: Consider changing "not 'pre' in self.context" to "'pre' not in self.context" (unnecessary-negation)
src/plugins/search/plugin.py:516:4: R0912: Too many branches (13/12) (too-many-branches)
************* Module src.plugins.social.plugin
src/plugins/social/plugin.py:189:8: W0622: Redefining built-in 'hash' (redefined-builtin)
src/plugins/social/plugin.py:152:15: C0209: Formatting a regular string which could be an f-string (consider-using-f-string)
src/plugins/social/plugin.py:174:12: W1203: Use lazy % formatting in logging functions (logging-fstring-interpolation)
src/plugins/social/plugin.py:182:12: W1203: Use lazy % formatting in logging functions (logging-fstring-interpolation)
src/plugins/social/plugin.py:224:5: W1518: 'lru_cache(maxsize=None)' or 'cache' will keep all method args alive indefinitely, including 'self' (method-cache-max-size-none)
src/plugins/social/plugin.py:265:5: W1518: 'lru_cache(maxsize=None)' or 'cache' will keep all method args alive indefinitely, including 'self' (method-cache-max-size-none)
src/plugins/social/plugin.py:270:5: W1518: 'lru_cache(maxsize=None)' or 'cache' will keep all method args alive indefinitely, including 'self' (method-cache-max-size-none)
src/plugins/social/plugin.py:275:4: R0913: Too many arguments (6/5) (too-many-arguments)
src/plugins/social/plugin.py:329:14: C0209: Formatting a regular string which could be an f-string (consider-using-f-string)
src/plugins/social/plugin.py:415:15: R1732: Consider using 'with' for resource-allocating operations (consider-using-with)
src/plugins/social/plugin.py:415:15: W1514: Using open without explicitly specifying an encoding (unspecified-encoding)
src/plugins/social/plugin.py:444:25: W0612: Unused variable 'folders' (unused-variable)
src/plugins/social/plugin.py:477:8: W0622: Redefining built-in 'zip' (redefined-builtin)
src/plugins/social/plugin.py:469:14: W3101: Missing timeout argument for method 'requests.get' can cause your program to hang indefinitely (missing-timeout)
src/plugins/social/plugin.py:477:14: R1732: Consider using 'with' for resource-allocating operations (consider-using-with)
src/plugins/social/plugin.py:73:8: W0201: Attribute 'color' defined outside init (attribute-defined-outside-init)
src/plugins/social/plugin.py:127:16: W0201: Attribute 'color' defined outside init (attribute-defined-outside-init)
src/plugins/social/plugin.py:131:8: W0201: Attribute 'color' defined outside init (attribute-defined-outside-init)
src/plugins/social/plugin.py:111:8: W0201: Attribute 'cache' defined outside init (attribute-defined-outside-init)
src/plugins/social/plugin.py:137:8: W0201: Attribute '_resized_logo_promise' defined outside init (attribute-defined-outside-init)
src/plugins/social/plugin.py:138:8: W0201: Attribute 'font' defined outside init (attribute-defined-outside-init)
src/plugins/social/plugin.py:140:8: W0201: Attribute '_image_promises' defined outside init (attribute-defined-outside-init)
************* Module src.plugins.blog.plugin
src/plugins/blog/plugin.py:243:31: W0212: Access to a protected member _title_from_render of a client class (protected-access)
src/plugins/blog/plugin.py:268:12: R1720: Unnecessary "else" after "raise", remove the "else" and de-indent the code inside it (no-else-raise)
src/plugins/blog/plugin.py:221:4: R1710: Either all return statements in a function should return an expression, or none of them should. (inconsistent-return-statements)
src/plugins/blog/plugin.py:418:8: W0212: Access to a protected member _set_canonical_url of a client class (protected-access)
src/plugins/blog/plugin.py:473:16: W0707: Consider explicitly re-raising using 'raise PluginError(f"Error reading authors file '{path}' in '{docs}':\n{e}") from e' (raise-missing-from)
src/plugins/blog/plugin.py:497:16: W0622: Redefining built-in 'next' (redefined-builtin)
src/plugins/blog/plugin.py:503:8: R1705: Unnecessary "else" after "return", remove the "else" and de-indent the code inside it (no-else-return)
src/plugins/blog/plugin.py:510:8: R1705: Unnecessary "else" after "return", remove the "else" and de-indent the code inside it (no-else-return)
src/plugins/blog/plugin.py:709:45: W0622: Redefining built-in 'range' (redefined-builtin)
src/plugins/blog/plugin.py:786:43: W0622: Redefining built-in 'format' (redefined-builtin)
src/plugins/blog/plugin.py:792:8: W0622: Redefining built-in 'format' (redefined-builtin)
src/plugins/blog/plugin.py:797:8: W0622: Redefining built-in 'format' (redefined-builtin)
src/plugins/blog/plugin.py:802:8: W0622: Redefining built-in 'format' (redefined-builtin)
src/plugins/blog/plugin.py:807:8: W0622: Redefining built-in 'format' (redefined-builtin)
src/plugins/blog/plugin.py:81:8: W0201: Attribute 'blog' defined outside init (attribute-defined-outside-init)
src/plugins/blog/plugin.py:132:8: W0201: Attribute 'blog' defined outside init (attribute-defined-outside-init)
src/plugins/blog/plugin.py:85:12: W0201: Attribute 'authors' defined outside init (attribute-defined-outside-init)
************* Module src.plugins.blog.structure.options
src/plugins/blog/structure/options.py:40:4: R1710: Either all return statements in a function should return an expression, or none of them should. (inconsistent-return-statements)
src/plugins/blog/structure/options.py:50:4: W0246: Useless parent or super() delegation in method 'init' (useless-parent-delegation)
************* Module src.plugins.blog.structure.markdown
src/plugins/blog/structure/markdown.py:34:4: W0231: init method from base class 'Treeprocessor' is not called (super-init-not-called)
src/plugins/blog/structure/markdown.py:31:0: R0903: Too few public methods (1/2) (too-few-public-methods)
************* Module src.plugins.blog.structure
src/plugins/blog/structure/init.py:85:16: W0707: Consider explicitly re-raising using 'raise PluginError(f"Error reading metadata of post '{path}' in '{docs}':\n{e}") from e' (raise-missing-from)
src/plugins/blog/structure/init.py:136:0: R0902: Too many instance attributes (10/7) (too-many-instance-attributes)
src/plugins/blog/structure/init.py:142:4: W0231: init method from base class 'Page' is not called (super-init-not-called)
src/plugins/blog/structure/init.py:187:4: W0237: Parameter 'config' has been renamed to 'page' in overriding 'Excerpt.render' method (arguments-renamed)
src/plugins/blog/structure/init.py:187:4: W0237: Parameter 'files' has been renamed to 'separator' in overriding 'Excerpt.render' method (arguments-renamed)
src/plugins/blog/structure/init.py:198:15: W0212: Access to a protected member _title_from_render of a client class (protected-access)
************* Module src.plugins.info.plugin
src/plugins/info/plugin.py:74:14: W3101: Missing timeout argument for method 'requests.get' can cause your program to hang indefinitely (missing-timeout)
src/plugins/info/plugin.py:197:14: W1309: Using an f-string that does not have any interpolated variables (f-string-without-interpolation)
src/plugins/info/plugin.py:231:0: R1710: Either all return statements in a function should return an expression, or none of them should. (inconsistent-return-statements)
************* Module src.plugins.group.plugin
src/plugins/group/plugin.py:145:0: C0325: Unnecessary parens after 'if' keyword (superfluous-parens)
src/plugins/group/plugin.py:66:31: W0212: Access to a protected member _schema of a client class (protected-access)
src/plugins/group/plugin.py:78:12: W0707: Consider explicitly re-raising using 'raise PluginError(str(e)) from e' (raise-missing-from)
src/plugins/group/plugin.py:104:4: R1710: Either all return statements in a function should return an expression, or none of them should. (inconsistent-return-statements)
src/plugins/group/plugin.py:113:26: W0212: Access to a protected member _parse_configs of a client class (protected-access)
src/plugins/group/plugin.py:43:8: W0201: Attribute 'is_serve' defined outside init (attribute-defined-outside-init)
src/plugins/group/plugin.py:44:8: W0201: Attribute 'is_dirty' defined outside init (attribute-defined-outside-init)
src/plugins/group/plugin.py:70:8: W0201: Attribute 'plugins' defined outside init (attribute-defined-outside-init)
************* Module src.plugins.privacy.plugin
src/plugins/privacy/plugin.py:74:4: R0912: Too many branches (13/12) (too-many-branches)
src/plugins/privacy/plugin.py:153:4: R1710: Either all return statements in a function should return an expression, or none of them should. (inconsistent-return-statements)
src/plugins/privacy/plugin.py:167:4: R1710: Either all return statements in a function should return an expression, or none of them should. (inconsistent-return-statements)
src/plugins/privacy/plugin.py:230:12: W1203: Use lazy % formatting in logging functions (logging-fstring-interpolation)
src/plugins/privacy/plugin.py:268:12: R1705: Unnecessary "else" after "return", remove the "else" and de-indent the code inside it (no-else-return)
src/plugins/privacy/plugin.py:289:23: R1714: Consider merging these comparisons with 'in' by using 'rel in ('stylesheet', 'icon')'. Use a set instead if elements are hashable. (consider-using-in)
src/plugins/privacy/plugin.py:294:15: R1714: Consider merging these comparisons with 'in' by using 'el.tag in ('script', 'img')'. Use a set instead if elements are hashable. (consider-using-in)
src/plugins/privacy/plugin.py:375:12: W1203: Use lazy % formatting in logging functions (logging-fstring-interpolation)
src/plugins/privacy/plugin.py:376:18: W3101: Missing timeout argument for method 'requests.get' can cause your program to hang indefinitely (missing-timeout)
src/plugins/privacy/plugin.py:405:24: W1203: Use lazy % formatting in logging functions (logging-fstring-interpolation)
src/plugins/privacy/plugin.py:55:8: W0201: Attribute 'site' defined outside init (attribute-defined-outside-init)
src/plugins/privacy/plugin.py:60:8: W0201: Attribute 'pool' defined outside init (attribute-defined-outside-init)
src/plugins/privacy/plugin.py:61:8: W0201: Attribute 'pool_jobs' defined outside init (attribute-defined-outside-init)
src/plugins/privacy/plugin.py:64:8: W0201: Attribute 'assets' defined outside init (attribute-defined-outside-init)
src/plugins/privacy/plugin.py:65:8: W0201: Attribute 'assets_expr_map' defined outside init (attribute-defined-outside-init)
************* Module src.plugins.tags.plugin
src/plugins/tags/plugin.py:83:4: R1710: Either all return statements in a function should return an expression, or none of them should. (inconsistent-return-statements)
src/plugins/tags/plugin.py:125:12: W1203: Use lazy % formatting in logging functions (logging-fstring-interpolation)
src/plugins/tags/plugin.py:148:12: W0622: Redefining built-in 'type' (redefined-builtin)
src/plugins/tags/plugin.py:170:8: W0622: Redefining built-in 'type' (redefined-builtin)
src/plugins/tags/plugin.py:171:8: R1705: Unnecessary "else" after "return", remove the "else" and de-indent the code inside it (no-else-return)
src/plugins/tags/plugin.py:172:19: R1735: Consider using '{"name": tag, "type": type}' instead of a call to 'dict'. (use-dict-literal)
src/plugins/tags/plugin.py:175:19: R1735: Consider using '{"name": tag, "type": type, "url": url}' instead of a call to 'dict'. (use-dict-literal)
src/plugins/tags/plugin.py:52:8: W0201: Attribute 'tags' defined outside init (attribute-defined-outside-init)
src/plugins/tags/plugin.py:53:8: W0201: Attribute 'tags_file' defined outside init (attribute-defined-outside-init)
src/plugins/tags/plugin.py:80:12: W0201: Attribute 'tags_file' defined outside init (attribute-defined-outside-init)
src/plugins/tags/plugin.py:56:8: W0201: Attribute 'tags_map' defined outside init (attribute-defined-outside-init)
src/plugins/tags/plugin.py:64:8: W0201: Attribute 'slugify' defined outside init (attribute-defined-outside-init)
Your code has been rated at 9.41/10 (previous run: 9.41/10, +0.00)
</details>
### Related links
- [Requesting a change](https://squidfunk.github.io/mkdocs-material/contributing/requesting-a-change/)
- https://github.com/pylint-dev/pylint
### Use Cases
Applies to the process of building the theme in the GitHub pipeline. Gives guidance to people who submit PRs.
### Visuals
_No response_
### Before submitting
- [X] I have read and followed the [change request guidelines](https://squidfunk.github.io/mkdocs-material/contributing/requesting-a-change/).
- [X] I have verified that [my idea is a change request and not a bug report](https://squidfunk.github.io/mkdocs-material/contributing/requesting-a-change/#its-not-a-bug-its-a-feature).
- [X] I have ensured that, to the best of my knowledge, [my idea will benefit the entire community](https://squidfunk.github.io/mkdocs-material/contributing/requesting-a-change/#benefit-for-the-community).
- [X] I have included relevant links to [the documentation](https://squidfunk.github.io/mkdocs-material/), related [issues](https://github.com/squidfunk/mkdocs-material/issues), and [discussions](https://github.com/squidfunk/mkdocs-material/discussions) to underline the need for my idea.
Context
The build process already contains configuration for ESLint (to check Typescript/JavaScript) and Stylelint for (S)CSS. It might be a good idea to also run a linter across the Python code.
Description
I propose that we start running Pylint on the Python code in Material for MkDocs. In order to make this step easier, I also suggest that we initially turn off most of the rules that are mainly stylistic such as ordering of imports or are about documentation (docstrings). Specifically, turn off these:
Once the other rules are satisfied, we can always revisit the ones that are initially turned off. Improving bit by bit seems the right approach to me. This avoids overwhelming us.
The change would involve adding Pylint as a
devdependency topyproject.toml, then a new run script topackage.jsonand, finally, a.pylintrcin the project root. Because adding these will add a checker to the build pipeline, the existing code would need to be cleaned up at the same time as these elements are being added. We are talking about ca. 100 lines that would be affected, see below. Let's discuss...Pylint log
``` $ pylint src************* Module src.extensions.emoji
src/extensions/emoji.py:44:0: R0913: Too many arguments (9/5) (too-many-arguments)
************* Module src.plugins.search.plugin
src/plugins/search/plugin.py:91:16: W1203: Use lazy % formatting in logging functions (logging-fstring-interpolation)
src/plugins/search/plugin.py:93:16: W1203: Use lazy % formatting in logging functions (logging-fstring-interpolation)
src/plugins/search/plugin.py:103:16: W1203: Use lazy % formatting in logging functions (logging-fstring-interpolation)
src/plugins/search/plugin.py:105:16: W1203: Use lazy % formatting in logging functions (logging-fstring-interpolation)
src/plugins/search/plugin.py:84:8: W0201: Attribute 'search_index' defined outside init (attribute-defined-outside-init)
src/plugins/search/plugin.py:273:35: W0622: Redefining built-in 'id' (redefined-builtin)
src/plugins/search/plugin.py:315:4: W0102: Dangerous default value {} as argument (dangerous-default-value)
src/plugins/search/plugin.py:325:8: R1705: Unnecessary "else" after "return", remove the "else" and de-indent the code inside it (no-else-return)
src/plugins/search/plugin.py:359:8: R1705: Unnecessary "else" after "return", remove the "else" and de-indent the code inside it (no-else-return)
src/plugins/search/plugin.py:406:4: R0912: Too many branches (13/12) (too-many-branches)
src/plugins/search/plugin.py:465:4: R0912: Too many branches (14/12) (too-many-branches)
src/plugins/search/plugin.py:521:11: C0117: Consider changing "not 'pre' in self.context" to "'pre' not in self.context" (unnecessary-negation)
src/plugins/search/plugin.py:516:4: R0912: Too many branches (13/12) (too-many-branches)
************* Module src.plugins.social.plugin
src/plugins/social/plugin.py:189:8: W0622: Redefining built-in 'hash' (redefined-builtin)
src/plugins/social/plugin.py:152:15: C0209: Formatting a regular string which could be an f-string (consider-using-f-string)
src/plugins/social/plugin.py:174:12: W1203: Use lazy % formatting in logging functions (logging-fstring-interpolation)
src/plugins/social/plugin.py:182:12: W1203: Use lazy % formatting in logging functions (logging-fstring-interpolation)
src/plugins/social/plugin.py:224:5: W1518: 'lru_cache(maxsize=None)' or 'cache' will keep all method args alive indefinitely, including 'self' (method-cache-max-size-none)
src/plugins/social/plugin.py:265:5: W1518: 'lru_cache(maxsize=None)' or 'cache' will keep all method args alive indefinitely, including 'self' (method-cache-max-size-none)
src/plugins/social/plugin.py:270:5: W1518: 'lru_cache(maxsize=None)' or 'cache' will keep all method args alive indefinitely, including 'self' (method-cache-max-size-none)
src/plugins/social/plugin.py:275:4: R0913: Too many arguments (6/5) (too-many-arguments)
src/plugins/social/plugin.py:329:14: C0209: Formatting a regular string which could be an f-string (consider-using-f-string)
src/plugins/social/plugin.py:415:15: R1732: Consider using 'with' for resource-allocating operations (consider-using-with)
src/plugins/social/plugin.py:415:15: W1514: Using open without explicitly specifying an encoding (unspecified-encoding)
src/plugins/social/plugin.py:444:25: W0612: Unused variable 'folders' (unused-variable)
src/plugins/social/plugin.py:477:8: W0622: Redefining built-in 'zip' (redefined-builtin)
src/plugins/social/plugin.py:469:14: W3101: Missing timeout argument for method 'requests.get' can cause your program to hang indefinitely (missing-timeout)
src/plugins/social/plugin.py:477:14: R1732: Consider using 'with' for resource-allocating operations (consider-using-with)
src/plugins/social/plugin.py:73:8: W0201: Attribute 'color' defined outside init (attribute-defined-outside-init)
src/plugins/social/plugin.py:127:16: W0201: Attribute 'color' defined outside init (attribute-defined-outside-init)
src/plugins/social/plugin.py:131:8: W0201: Attribute 'color' defined outside init (attribute-defined-outside-init)
src/plugins/social/plugin.py:111:8: W0201: Attribute 'cache' defined outside init (attribute-defined-outside-init)
src/plugins/social/plugin.py:137:8: W0201: Attribute '_resized_logo_promise' defined outside init (attribute-defined-outside-init)
src/plugins/social/plugin.py:138:8: W0201: Attribute 'font' defined outside init (attribute-defined-outside-init)
src/plugins/social/plugin.py:140:8: W0201: Attribute '_image_promises' defined outside init (attribute-defined-outside-init)
************* Module src.plugins.blog.plugin
src/plugins/blog/plugin.py:243:31: W0212: Access to a protected member _title_from_render of a client class (protected-access)
src/plugins/blog/plugin.py:268:12: R1720: Unnecessary "else" after "raise", remove the "else" and de-indent the code inside it (no-else-raise)
src/plugins/blog/plugin.py:221:4: R1710: Either all return statements in a function should return an expression, or none of them should. (inconsistent-return-statements)
src/plugins/blog/plugin.py:418:8: W0212: Access to a protected member _set_canonical_url of a client class (protected-access)
src/plugins/blog/plugin.py:473:16: W0707: Consider explicitly re-raising using 'raise PluginError(f"Error reading authors file '{path}' in '{docs}':\n{e}") from e' (raise-missing-from)
src/plugins/blog/plugin.py:497:16: W0622: Redefining built-in 'next' (redefined-builtin)
src/plugins/blog/plugin.py:503:8: R1705: Unnecessary "else" after "return", remove the "else" and de-indent the code inside it (no-else-return)
src/plugins/blog/plugin.py:510:8: R1705: Unnecessary "else" after "return", remove the "else" and de-indent the code inside it (no-else-return)
src/plugins/blog/plugin.py:709:45: W0622: Redefining built-in 'range' (redefined-builtin)
src/plugins/blog/plugin.py:786:43: W0622: Redefining built-in 'format' (redefined-builtin)
src/plugins/blog/plugin.py:792:8: W0622: Redefining built-in 'format' (redefined-builtin)
src/plugins/blog/plugin.py:797:8: W0622: Redefining built-in 'format' (redefined-builtin)
src/plugins/blog/plugin.py:802:8: W0622: Redefining built-in 'format' (redefined-builtin)
src/plugins/blog/plugin.py:807:8: W0622: Redefining built-in 'format' (redefined-builtin)
src/plugins/blog/plugin.py:81:8: W0201: Attribute 'blog' defined outside init (attribute-defined-outside-init)
src/plugins/blog/plugin.py:132:8: W0201: Attribute 'blog' defined outside init (attribute-defined-outside-init)
src/plugins/blog/plugin.py:85:12: W0201: Attribute 'authors' defined outside init (attribute-defined-outside-init)
************* Module src.plugins.blog.structure.options
src/plugins/blog/structure/options.py:40:4: R1710: Either all return statements in a function should return an expression, or none of them should. (inconsistent-return-statements)
src/plugins/blog/structure/options.py:50:4: W0246: Useless parent or super() delegation in method 'init' (useless-parent-delegation)
************* Module src.plugins.blog.structure.markdown
src/plugins/blog/structure/markdown.py:34:4: W0231: init method from base class 'Treeprocessor' is not called (super-init-not-called)
src/plugins/blog/structure/markdown.py:31:0: R0903: Too few public methods (1/2) (too-few-public-methods)
************* Module src.plugins.blog.structure
src/plugins/blog/structure/init.py:85:16: W0707: Consider explicitly re-raising using 'raise PluginError(f"Error reading metadata of post '{path}' in '{docs}':\n{e}") from e' (raise-missing-from)
src/plugins/blog/structure/init.py:136:0: R0902: Too many instance attributes (10/7) (too-many-instance-attributes)
src/plugins/blog/structure/init.py:142:4: W0231: init method from base class 'Page' is not called (super-init-not-called)
src/plugins/blog/structure/init.py:187:4: W0237: Parameter 'config' has been renamed to 'page' in overriding 'Excerpt.render' method (arguments-renamed)
src/plugins/blog/structure/init.py:187:4: W0237: Parameter 'files' has been renamed to 'separator' in overriding 'Excerpt.render' method (arguments-renamed)
src/plugins/blog/structure/init.py:198:15: W0212: Access to a protected member _title_from_render of a client class (protected-access)
************* Module src.plugins.info.plugin
src/plugins/info/plugin.py:74:14: W3101: Missing timeout argument for method 'requests.get' can cause your program to hang indefinitely (missing-timeout)
src/plugins/info/plugin.py:197:14: W1309: Using an f-string that does not have any interpolated variables (f-string-without-interpolation)
src/plugins/info/plugin.py:231:0: R1710: Either all return statements in a function should return an expression, or none of them should. (inconsistent-return-statements)
************* Module src.plugins.group.plugin
src/plugins/group/plugin.py:145:0: C0325: Unnecessary parens after 'if' keyword (superfluous-parens)
src/plugins/group/plugin.py:66:31: W0212: Access to a protected member _schema of a client class (protected-access)
src/plugins/group/plugin.py:78:12: W0707: Consider explicitly re-raising using 'raise PluginError(str(e)) from e' (raise-missing-from)
src/plugins/group/plugin.py:104:4: R1710: Either all return statements in a function should return an expression, or none of them should. (inconsistent-return-statements)
src/plugins/group/plugin.py:113:26: W0212: Access to a protected member _parse_configs of a client class (protected-access)
src/plugins/group/plugin.py:43:8: W0201: Attribute 'is_serve' defined outside init (attribute-defined-outside-init)
src/plugins/group/plugin.py:44:8: W0201: Attribute 'is_dirty' defined outside init (attribute-defined-outside-init)
src/plugins/group/plugin.py:70:8: W0201: Attribute 'plugins' defined outside init (attribute-defined-outside-init)
************* Module src.plugins.privacy.plugin
src/plugins/privacy/plugin.py:74:4: R0912: Too many branches (13/12) (too-many-branches)
src/plugins/privacy/plugin.py:153:4: R1710: Either all return statements in a function should return an expression, or none of them should. (inconsistent-return-statements)
src/plugins/privacy/plugin.py:167:4: R1710: Either all return statements in a function should return an expression, or none of them should. (inconsistent-return-statements)
src/plugins/privacy/plugin.py:230:12: W1203: Use lazy % formatting in logging functions (logging-fstring-interpolation)
src/plugins/privacy/plugin.py:268:12: R1705: Unnecessary "else" after "return", remove the "else" and de-indent the code inside it (no-else-return)
src/plugins/privacy/plugin.py:289:23: R1714: Consider merging these comparisons with 'in' by using 'rel in ('stylesheet', 'icon')'. Use a set instead if elements are hashable. (consider-using-in)
src/plugins/privacy/plugin.py:294:15: R1714: Consider merging these comparisons with 'in' by using 'el.tag in ('script', 'img')'. Use a set instead if elements are hashable. (consider-using-in)
src/plugins/privacy/plugin.py:375:12: W1203: Use lazy % formatting in logging functions (logging-fstring-interpolation)
src/plugins/privacy/plugin.py:376:18: W3101: Missing timeout argument for method 'requests.get' can cause your program to hang indefinitely (missing-timeout)
src/plugins/privacy/plugin.py:405:24: W1203: Use lazy % formatting in logging functions (logging-fstring-interpolation)
src/plugins/privacy/plugin.py:55:8: W0201: Attribute 'site' defined outside init (attribute-defined-outside-init)
src/plugins/privacy/plugin.py:60:8: W0201: Attribute 'pool' defined outside init (attribute-defined-outside-init)
src/plugins/privacy/plugin.py:61:8: W0201: Attribute 'pool_jobs' defined outside init (attribute-defined-outside-init)
src/plugins/privacy/plugin.py:64:8: W0201: Attribute 'assets' defined outside init (attribute-defined-outside-init)
src/plugins/privacy/plugin.py:65:8: W0201: Attribute 'assets_expr_map' defined outside init (attribute-defined-outside-init)
************* Module src.plugins.tags.plugin
src/plugins/tags/plugin.py:83:4: R1710: Either all return statements in a function should return an expression, or none of them should. (inconsistent-return-statements)
src/plugins/tags/plugin.py:125:12: W1203: Use lazy % formatting in logging functions (logging-fstring-interpolation)
src/plugins/tags/plugin.py:148:12: W0622: Redefining built-in 'type' (redefined-builtin)
src/plugins/tags/plugin.py:170:8: W0622: Redefining built-in 'type' (redefined-builtin)
src/plugins/tags/plugin.py:171:8: R1705: Unnecessary "else" after "return", remove the "else" and de-indent the code inside it (no-else-return)
src/plugins/tags/plugin.py:172:19: R1735: Consider using '{"name": tag, "type": type}' instead of a call to 'dict'. (use-dict-literal)
src/plugins/tags/plugin.py:175:19: R1735: Consider using '{"name": tag, "type": type, "url": url}' instead of a call to 'dict'. (use-dict-literal)
src/plugins/tags/plugin.py:52:8: W0201: Attribute 'tags' defined outside init (attribute-defined-outside-init)
src/plugins/tags/plugin.py:53:8: W0201: Attribute 'tags_file' defined outside init (attribute-defined-outside-init)
src/plugins/tags/plugin.py:80:12: W0201: Attribute 'tags_file' defined outside init (attribute-defined-outside-init)
src/plugins/tags/plugin.py:56:8: W0201: Attribute 'tags_map' defined outside init (attribute-defined-outside-init)
src/plugins/tags/plugin.py:64:8: W0201: Attribute 'slugify' defined outside init (attribute-defined-outside-init)
Your code has been rated at 9.41/10 (previous run: 9.41/10, +0.00)