{"id":200358,"date":"2023-12-20T09:37:30","date_gmt":"2023-12-20T14:37:30","guid":{"rendered":"https:\/\/ibkrcampus.com\/?p=200358"},"modified":"2023-12-20T09:37:59","modified_gmt":"2023-12-20T14:37:59","slug":"mastering-python-linters-a-guide-for-developers","status":"publish","type":"post","link":"https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/mastering-python-linters-a-guide-for-developers\/","title":{"rendered":"Mastering Python Linters: A Guide for Developers"},"content":{"rendered":"\n<p><em>The article &#8220;Mastering Python Linters: A Guide for Developers&#8221; first appeared on <a href=\"https:\/\/algotrading101.com\/learn\/python-linters-guide\/\">AlgoTrading101<\/a> blog.<\/em><\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-what-are-python-linters\">What are Python linters?<\/h2>\n\n\n\n<p>Python linters are tools for developers that do automated code analysis. They play a crucial role in improving code quality by scanning Python code to identify syntax errors, stylistic issues, and complex constructs that deviate from best coding practices.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-what-types-of-python-linters-exist\">What types of Python linters exist?<\/h2>\n\n\n\n<p>Types of Python linters can be categorized into two groups which are&nbsp;<strong>Code formatting and style<\/strong>&nbsp;and&nbsp;<strong>Error Detection<\/strong>.<\/p>\n\n\n\n<p>The first group checks if the code adheres to the stylistic guidelines, such as PEP 8, which is the style guide for Python code. This includes checking indentation, line spacing, and the use of variables and function names.<\/p>\n\n\n\n<p>The second group uncovers potential errors before the code is executed. They pinpoint issues like undeclared variables, possible syntax errors, and other inconsistencies that could lead to bugs.<\/p>\n\n\n\n<p>Sometimes, some linters fall into both groups and we will cover them in this article.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-why-should-i-use-python-linters\">Why should I use Python Linters?<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Python linters make your code cleaner.<\/li>\n\n\n\n<li>Make your code easier to maintain and read.<\/li>\n\n\n\n<li>Spot bugs and errors in your code in time.<\/li>\n\n\n\n<li>Allow for a better collaboration experience.<\/li>\n\n\n\n<li>It makes you more productive.<\/li>\n\n\n\n<li>It teaches you to write better code.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-why-shouldn-t-i-use-python-linters\">Why shouldn\u2019t I use Python Linters?<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Python linters can slow down prototyping and fast iterating.<\/li>\n\n\n\n<li>Over-reliance leads to a false sense of security.<\/li>\n\n\n\n<li>Can bring much overhead on small and simple projects.<\/li>\n\n\n\n<li>Can have a higher learning curve for Python beginners.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-how-to-get-started-with-python-linters\">How to get started with Python linters?<\/h2>\n\n\n\n<p>To get started with Python linters, all you need to do is to install them via&nbsp;<code>pip<\/code>&nbsp;and configure them if needed. Most linters prefer pure Python files (e.g. ruff) while others can also style your notebooks (e.g. black).<\/p>\n\n\n\n<p>The linters that we will take a look at are the linters I personally use for all my projects which are the following:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Black<\/li>\n\n\n\n<li>Pylint<\/li>\n\n\n\n<li>Ruff<\/li>\n\n\n\n<li>MyPy<\/li>\n\n\n\n<li>Bandit<\/li>\n\n\n\n<li>PyDocstyle<\/li>\n<\/ul>\n\n\n\n<p>We will look into each one of them and I\u2019ll show you how to work with them. Then, we\u2019ll combine them together into a pre-commit hook that will check all of our files and stop the commit if we have linting errors.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-black-python-linter-what-is-it-and-how-can-it-transform-your-code\"><strong>Black Python Linter: What Is It and How Can It Transform Your Code?<\/strong><\/h2>\n\n\n\n<p>Black is a Python code formatter known for its uncompromising approach to code styling. It prioritizes consistency and determinism in code formatting for a uniform style. It aims for simplicity and minimization of diff sizes.<\/p>\n\n\n\n<p><a>Link to repository:&nbsp;<\/a><a href=\"https:\/\/github.com\/psf\/black\">https:\/\/github.com\/psf\/black<\/a><\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-how-to-install-black\">How to install Black?<\/h3>\n\n\n\n<p>To install Black, all you need to do is write:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">pip install black<\/pre>\n\n\n\n<p>If you want black to work with your notebook files, you can additionally write:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">pip install \"black[jupyter]\"<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">How to use Black<\/h3>\n\n\n\n<p>Using Black is as simple as running a single command. To format a single Python file:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">black your_script.py<\/pre>\n\n\n\n<p>To format a directory, you can do:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">black my_dir<\/pre>\n\n\n\n<p>To format all files at your current location do:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">black .<\/pre>\n\n\n\n<p>For example, here is a small code block before Black is applied:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">def my_function(arg1,arg2):\n    print( \"arg1:\",arg1,\"arg2:\",arg2)<\/pre>\n\n\n\n<p>Here is the after:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">def my_function(arg1, arg2):\n    print(\"arg1:\", arg1, \"arg2:\", arg2)<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">How to configure Black?<\/h3>\n\n\n\n<p>Black aims to be an opinionated formatter, so configuration options are minimal. However, you can configure line length (default is 88 characters) and exclude specific files. For example, to set a line length of 100 characters:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">black your_script.py -l 100<\/pre>\n\n\n\n<p>To exclude a directory or a file, use the&nbsp;<code>--exclude<\/code>&nbsp;parameter. Here\u2019s how to exclude a directory named&nbsp;<code>migrations<\/code>:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">black your_directory --exclude='\/migrations\/'<\/pre>\n\n\n\n<p>Configuration can also be specified in a&nbsp;<code>pyproject.toml<\/code>&nbsp;file, which Black will automatically detect and use. For example:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">[tool.black]\nline-length = 100\nexclude = '''\n\/(\n    migrations\n)\/\n'''<\/pre>\n\n\n\n<p>The code block above combines the two configuration options we ran manually. This way, you can run black without the need to pass extra arguments.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Pylint Python Linter: Why Is It a Game-Changer for Python Developers?<\/strong><\/h2>\n\n\n\n<p>Pylint is a versatile Python linter for static code analysis. It checks Python code against a wide range of programming standards, highlights errors, and enforces a more explicit coding standard.<\/p>\n\n\n\n<p>It offers detailed reports on code quality, potentially problematic areas, code duplication, styling issues, and more. It is quite customizable and supports plugins.<\/p>\n\n\n\n<p><a>Link to repository:<\/a><a href=\"https:\/\/github.com\/pylint-dev\/pylint\">&nbsp;https:\/\/github.com\/pylint-dev\/pylint<\/a><\/p>\n\n\n\n<h3 class=\"wp-block-heading\">How to install Pylint?<\/h3>\n\n\n\n<p>Installing Pylint is straightforward and can be done using pip:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">pip install pylint<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">How to use Pylint?<\/h3>\n\n\n\n<p>To use Pylint, simply run it against a Python file or a module. For example, to lint a single file:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">pylint your_script.py<\/pre>\n\n\n\n<p>For linting an entire Python package:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">pylint your_package\/<\/pre>\n\n\n\n<p>Pylint will analyze the code and output a report detailing various issues, categorized by their nature (e.g., errors, warnings, refactor suggestions).<\/p>\n\n\n\n<p>Here is an example code block before abiding by Pylint:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">class my_class:\n    def func1(self):\n        pass\n\n    def anotherFunction(self, arg1):\n        self.myvar = arg1\n        print(arg1)\n\nobj = my_class()\nobj.func1()\nobj.anotherFunction(10)<\/pre>\n\n\n\n<p>Here is the code block after cleaning out Pylint errors:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">class MyClass:\n    \"\"\"Example class demonstrating Pylint improvements.\"\"\"\n\n    def __init__(self):\n        \"\"\"Initialize the class.\"\"\"\n        self.my_var = None\n\n    def function_one(self):\n        \"\"\"Example method that does nothing.\"\"\"\n        # Previously had 'pass', removed as it's unnecessary here.\n\n    def another_function(self, arg1):\n        \"\"\"Print the provided argument.\n\n        Args:\n            arg1 (int): The argument to be printed.\n        \"\"\"\n        self.my_var = arg1\n        print(arg1)\n\nobj = MyClass()\nobj.function_one()\nobj.another_function(10)<\/pre>\n\n\n\n<p>Sometimes, Pylint might be wrong in its interpretation. In that case, you can ignore specific Pylint errors either in your entire file, specific line, specific function\/class, or more.<\/p>\n\n\n\n<p>For instance, if you want to ignore a particular warning, say&nbsp;<code>line-too-long (C0301)<\/code>, on a specific line, you can do the following:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">some_really_long_line = '...'  # pylint: disable=line-too-long<\/pre>\n\n\n\n<p>You can also just write the code of the error but that makes your ignored error less explicit. To disable a warning for an entire file, add a comment at the top of the file:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\"># pylint: disable=line-too-long<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">How to configure Pylint?<\/h3>\n\n\n\n<p>Pylint is highly customizable. You can configure it by creating a&nbsp;<code>.pylintrc<\/code>&nbsp;file in your project\u2019s root directory. Here\u2019s a simple example of a&nbsp;<code>.pylintrc<\/code>&nbsp;file:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">[MASTER]\ndisable=\n    C0111, # missing-docstring\n    C0103  # invalid-name\n\n[MESSAGES CONTROL]\nmax-line-length=100<\/pre>\n\n\n\n<p><em>Visit <a href=\"https:\/\/algotrading101.com\/learn\/python-linters-guide\/\">AlgoTrading101<\/a> blog to read the full article<\/em>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Types of Python linters can be categorized into two groups which are Code formatting and style and Error Detection.<\/p>\n","protected":false},"author":815,"featured_media":200368,"comment_status":"open","ping_status":"closed","sticky":true,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[339,343,349,338,341],"tags":[806,16463,16462],"contributors-categories":[13746],"class_list":{"0":"post-200358","1":"post","2":"type-post","3":"status-publish","4":"format-standard","5":"has-post-thumbnail","7":"category-data-science","8":"category-programing-languages","9":"category-python-development","10":"category-ibkr-quant-news","11":"category-quant-development","12":"tag-data-science","13":"tag-pylint","14":"tag-python-linters","15":"contributors-categories-algotrading101"},"pp_statuses_selecting_workflow":false,"pp_workflow_action":"current","pp_status_selection":"publish","acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v26.9 (Yoast SEO v27.4) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>Mastering Python Linters: A Guide for Developers<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.interactivebrokers.com\/campus\/wp-json\/wp\/v2\/posts\/200358\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Mastering Python Linters: A Guide for Developers | IBKR Campus US\" \/>\n<meta property=\"og:description\" content=\"Types of Python linters can be categorized into two groups which are Code formatting and style and Error Detection.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/mastering-python-linters-a-guide-for-developers\/\" \/>\n<meta property=\"og:site_name\" content=\"IBKR Campus US\" \/>\n<meta property=\"article:published_time\" content=\"2023-12-20T14:37:30+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-12-20T14:37:59+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.interactivebrokers.com\/campus\/wp-content\/uploads\/sites\/2\/2023\/12\/python-wooden-word-cube.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1000\" \/>\n\t<meta property=\"og:image:height\" content=\"563\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Igor Radovanovic\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Igor Radovanovic\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\n\t    \"@context\": \"https:\\\/\\\/schema.org\",\n\t    \"@graph\": [\n\t        {\n\t            \"@type\": \"NewsArticle\",\n\t            \"@id\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/ibkr-quant-news\\\/mastering-python-linters-a-guide-for-developers\\\/#article\",\n\t            \"isPartOf\": {\n\t                \"@id\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/ibkr-quant-news\\\/mastering-python-linters-a-guide-for-developers\\\/\"\n\t            },\n\t            \"author\": {\n\t                \"name\": \"Igor Radovanovic\",\n\t                \"@id\": \"https:\\\/\\\/ibkrcampus.com\\\/campus\\\/#\\\/schema\\\/person\\\/b43b33f424bad38d84a7b78eb0193592\"\n\t            },\n\t            \"headline\": \"Mastering Python Linters: A Guide for Developers\",\n\t            \"datePublished\": \"2023-12-20T14:37:30+00:00\",\n\t            \"dateModified\": \"2023-12-20T14:37:59+00:00\",\n\t            \"mainEntityOfPage\": {\n\t                \"@id\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/ibkr-quant-news\\\/mastering-python-linters-a-guide-for-developers\\\/\"\n\t            },\n\t            \"wordCount\": 909,\n\t            \"commentCount\": 0,\n\t            \"publisher\": {\n\t                \"@id\": \"https:\\\/\\\/ibkrcampus.com\\\/campus\\\/#organization\"\n\t            },\n\t            \"image\": {\n\t                \"@id\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/ibkr-quant-news\\\/mastering-python-linters-a-guide-for-developers\\\/#primaryimage\"\n\t            },\n\t            \"thumbnailUrl\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/wp-content\\\/uploads\\\/sites\\\/2\\\/2023\\\/12\\\/python-wooden-word-cube.jpg\",\n\t            \"keywords\": [\n\t                \"Data Science\",\n\t                \"Pylint\",\n\t                \"Python Linters\"\n\t            ],\n\t            \"articleSection\": [\n\t                \"Data Science\",\n\t                \"Programming Languages\",\n\t                \"Python Development\",\n\t                \"Quant\",\n\t                \"Quant Development\"\n\t            ],\n\t            \"inLanguage\": \"en-US\",\n\t            \"potentialAction\": [\n\t                {\n\t                    \"@type\": \"CommentAction\",\n\t                    \"name\": \"Comment\",\n\t                    \"target\": [\n\t                        \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/ibkr-quant-news\\\/mastering-python-linters-a-guide-for-developers\\\/#respond\"\n\t                    ]\n\t                }\n\t            ]\n\t        },\n\t        {\n\t            \"@type\": \"WebPage\",\n\t            \"@id\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/ibkr-quant-news\\\/mastering-python-linters-a-guide-for-developers\\\/\",\n\t            \"url\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/ibkr-quant-news\\\/mastering-python-linters-a-guide-for-developers\\\/\",\n\t            \"name\": \"Mastering Python Linters: A Guide for Developers | IBKR Campus US\",\n\t            \"isPartOf\": {\n\t                \"@id\": \"https:\\\/\\\/ibkrcampus.com\\\/campus\\\/#website\"\n\t            },\n\t            \"primaryImageOfPage\": {\n\t                \"@id\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/ibkr-quant-news\\\/mastering-python-linters-a-guide-for-developers\\\/#primaryimage\"\n\t            },\n\t            \"image\": {\n\t                \"@id\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/ibkr-quant-news\\\/mastering-python-linters-a-guide-for-developers\\\/#primaryimage\"\n\t            },\n\t            \"thumbnailUrl\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/wp-content\\\/uploads\\\/sites\\\/2\\\/2023\\\/12\\\/python-wooden-word-cube.jpg\",\n\t            \"datePublished\": \"2023-12-20T14:37:30+00:00\",\n\t            \"dateModified\": \"2023-12-20T14:37:59+00:00\",\n\t            \"inLanguage\": \"en-US\",\n\t            \"potentialAction\": [\n\t                {\n\t                    \"@type\": \"ReadAction\",\n\t                    \"target\": [\n\t                        \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/ibkr-quant-news\\\/mastering-python-linters-a-guide-for-developers\\\/\"\n\t                    ]\n\t                }\n\t            ]\n\t        },\n\t        {\n\t            \"@type\": \"ImageObject\",\n\t            \"inLanguage\": \"en-US\",\n\t            \"@id\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/ibkr-quant-news\\\/mastering-python-linters-a-guide-for-developers\\\/#primaryimage\",\n\t            \"url\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/wp-content\\\/uploads\\\/sites\\\/2\\\/2023\\\/12\\\/python-wooden-word-cube.jpg\",\n\t            \"contentUrl\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/wp-content\\\/uploads\\\/sites\\\/2\\\/2023\\\/12\\\/python-wooden-word-cube.jpg\",\n\t            \"width\": 1000,\n\t            \"height\": 563,\n\t            \"caption\": \"Quant\"\n\t        },\n\t        {\n\t            \"@type\": \"WebSite\",\n\t            \"@id\": \"https:\\\/\\\/ibkrcampus.com\\\/campus\\\/#website\",\n\t            \"url\": \"https:\\\/\\\/ibkrcampus.com\\\/campus\\\/\",\n\t            \"name\": \"IBKR Campus US\",\n\t            \"description\": \"Financial Education from Interactive Brokers\",\n\t            \"publisher\": {\n\t                \"@id\": \"https:\\\/\\\/ibkrcampus.com\\\/campus\\\/#organization\"\n\t            },\n\t            \"potentialAction\": [\n\t                {\n\t                    \"@type\": \"SearchAction\",\n\t                    \"target\": {\n\t                        \"@type\": \"EntryPoint\",\n\t                        \"urlTemplate\": \"https:\\\/\\\/ibkrcampus.com\\\/campus\\\/?s={search_term_string}\"\n\t                    },\n\t                    \"query-input\": {\n\t                        \"@type\": \"PropertyValueSpecification\",\n\t                        \"valueRequired\": true,\n\t                        \"valueName\": \"search_term_string\"\n\t                    }\n\t                }\n\t            ],\n\t            \"inLanguage\": \"en-US\"\n\t        },\n\t        {\n\t            \"@type\": \"Organization\",\n\t            \"@id\": \"https:\\\/\\\/ibkrcampus.com\\\/campus\\\/#organization\",\n\t            \"name\": \"Interactive Brokers\",\n\t            \"alternateName\": \"IBKR\",\n\t            \"url\": \"https:\\\/\\\/ibkrcampus.com\\\/campus\\\/\",\n\t            \"logo\": {\n\t                \"@type\": \"ImageObject\",\n\t                \"inLanguage\": \"en-US\",\n\t                \"@id\": \"https:\\\/\\\/ibkrcampus.com\\\/campus\\\/#\\\/schema\\\/logo\\\/image\\\/\",\n\t                \"url\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/wp-content\\\/uploads\\\/sites\\\/2\\\/2024\\\/05\\\/ibkr-campus-logo.jpg\",\n\t                \"contentUrl\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/wp-content\\\/uploads\\\/sites\\\/2\\\/2024\\\/05\\\/ibkr-campus-logo.jpg\",\n\t                \"width\": 669,\n\t                \"height\": 669,\n\t                \"caption\": \"Interactive Brokers\"\n\t            },\n\t            \"image\": {\n\t                \"@id\": \"https:\\\/\\\/ibkrcampus.com\\\/campus\\\/#\\\/schema\\\/logo\\\/image\\\/\"\n\t            },\n\t            \"publishingPrinciples\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/about-ibkr-campus\\\/\",\n\t            \"ethicsPolicy\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/cyber-security-notice\\\/\"\n\t        },\n\t        {\n\t            \"@type\": \"Person\",\n\t            \"@id\": \"https:\\\/\\\/ibkrcampus.com\\\/campus\\\/#\\\/schema\\\/person\\\/b43b33f424bad38d84a7b78eb0193592\",\n\t            \"name\": \"Igor Radovanovic\",\n\t            \"url\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/author\\\/igor-radovanovic\\\/\"\n\t        }\n\t    ]\n\t}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Mastering Python Linters: A Guide for Developers","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.interactivebrokers.com\/campus\/wp-json\/wp\/v2\/posts\/200358\/","og_locale":"en_US","og_type":"article","og_title":"Mastering Python Linters: A Guide for Developers | IBKR Campus US","og_description":"Types of Python linters can be categorized into two groups which are Code formatting and style and Error Detection.","og_url":"https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/mastering-python-linters-a-guide-for-developers\/","og_site_name":"IBKR Campus US","article_published_time":"2023-12-20T14:37:30+00:00","article_modified_time":"2023-12-20T14:37:59+00:00","og_image":[{"width":1000,"height":563,"url":"https:\/\/www.interactivebrokers.com\/campus\/wp-content\/uploads\/sites\/2\/2023\/12\/python-wooden-word-cube.jpg","type":"image\/jpeg"}],"author":"Igor Radovanovic","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Igor Radovanovic","Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"NewsArticle","@id":"https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/mastering-python-linters-a-guide-for-developers\/#article","isPartOf":{"@id":"https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/mastering-python-linters-a-guide-for-developers\/"},"author":{"name":"Igor Radovanovic","@id":"https:\/\/ibkrcampus.com\/campus\/#\/schema\/person\/b43b33f424bad38d84a7b78eb0193592"},"headline":"Mastering Python Linters: A Guide for Developers","datePublished":"2023-12-20T14:37:30+00:00","dateModified":"2023-12-20T14:37:59+00:00","mainEntityOfPage":{"@id":"https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/mastering-python-linters-a-guide-for-developers\/"},"wordCount":909,"commentCount":0,"publisher":{"@id":"https:\/\/ibkrcampus.com\/campus\/#organization"},"image":{"@id":"https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/mastering-python-linters-a-guide-for-developers\/#primaryimage"},"thumbnailUrl":"https:\/\/www.interactivebrokers.com\/campus\/wp-content\/uploads\/sites\/2\/2023\/12\/python-wooden-word-cube.jpg","keywords":["Data Science","Pylint","Python Linters"],"articleSection":["Data Science","Programming Languages","Python Development","Quant","Quant Development"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/mastering-python-linters-a-guide-for-developers\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/mastering-python-linters-a-guide-for-developers\/","url":"https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/mastering-python-linters-a-guide-for-developers\/","name":"Mastering Python Linters: A Guide for Developers | IBKR Campus US","isPartOf":{"@id":"https:\/\/ibkrcampus.com\/campus\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/mastering-python-linters-a-guide-for-developers\/#primaryimage"},"image":{"@id":"https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/mastering-python-linters-a-guide-for-developers\/#primaryimage"},"thumbnailUrl":"https:\/\/www.interactivebrokers.com\/campus\/wp-content\/uploads\/sites\/2\/2023\/12\/python-wooden-word-cube.jpg","datePublished":"2023-12-20T14:37:30+00:00","dateModified":"2023-12-20T14:37:59+00:00","inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/mastering-python-linters-a-guide-for-developers\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/mastering-python-linters-a-guide-for-developers\/#primaryimage","url":"https:\/\/www.interactivebrokers.com\/campus\/wp-content\/uploads\/sites\/2\/2023\/12\/python-wooden-word-cube.jpg","contentUrl":"https:\/\/www.interactivebrokers.com\/campus\/wp-content\/uploads\/sites\/2\/2023\/12\/python-wooden-word-cube.jpg","width":1000,"height":563,"caption":"Quant"},{"@type":"WebSite","@id":"https:\/\/ibkrcampus.com\/campus\/#website","url":"https:\/\/ibkrcampus.com\/campus\/","name":"IBKR Campus US","description":"Financial Education from Interactive Brokers","publisher":{"@id":"https:\/\/ibkrcampus.com\/campus\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/ibkrcampus.com\/campus\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/ibkrcampus.com\/campus\/#organization","name":"Interactive Brokers","alternateName":"IBKR","url":"https:\/\/ibkrcampus.com\/campus\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/ibkrcampus.com\/campus\/#\/schema\/logo\/image\/","url":"https:\/\/www.interactivebrokers.com\/campus\/wp-content\/uploads\/sites\/2\/2024\/05\/ibkr-campus-logo.jpg","contentUrl":"https:\/\/www.interactivebrokers.com\/campus\/wp-content\/uploads\/sites\/2\/2024\/05\/ibkr-campus-logo.jpg","width":669,"height":669,"caption":"Interactive Brokers"},"image":{"@id":"https:\/\/ibkrcampus.com\/campus\/#\/schema\/logo\/image\/"},"publishingPrinciples":"https:\/\/www.interactivebrokers.com\/campus\/about-ibkr-campus\/","ethicsPolicy":"https:\/\/www.interactivebrokers.com\/campus\/cyber-security-notice\/"},{"@type":"Person","@id":"https:\/\/ibkrcampus.com\/campus\/#\/schema\/person\/b43b33f424bad38d84a7b78eb0193592","name":"Igor Radovanovic","url":"https:\/\/www.interactivebrokers.com\/campus\/author\/igor-radovanovic\/"}]}},"jetpack_featured_media_url":"https:\/\/www.interactivebrokers.com\/campus\/wp-content\/uploads\/sites\/2\/2023\/12\/python-wooden-word-cube.jpg","_links":{"self":[{"href":"https:\/\/ibkrcampus.com\/campus\/wp-json\/wp\/v2\/posts\/200358","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ibkrcampus.com\/campus\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ibkrcampus.com\/campus\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ibkrcampus.com\/campus\/wp-json\/wp\/v2\/users\/815"}],"replies":[{"embeddable":true,"href":"https:\/\/ibkrcampus.com\/campus\/wp-json\/wp\/v2\/comments?post=200358"}],"version-history":[{"count":0,"href":"https:\/\/ibkrcampus.com\/campus\/wp-json\/wp\/v2\/posts\/200358\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/ibkrcampus.com\/campus\/wp-json\/wp\/v2\/media\/200368"}],"wp:attachment":[{"href":"https:\/\/ibkrcampus.com\/campus\/wp-json\/wp\/v2\/media?parent=200358"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ibkrcampus.com\/campus\/wp-json\/wp\/v2\/categories?post=200358"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ibkrcampus.com\/campus\/wp-json\/wp\/v2\/tags?post=200358"},{"taxonomy":"contributors-categories","embeddable":true,"href":"https:\/\/ibkrcampus.com\/campus\/wp-json\/wp\/v2\/contributors-categories?post=200358"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}