arXiv:2610.35485cs.SEOct 2026

Manuscript Offprint

arXiv:2610.35485

Understanding Python Linters through a Comprehensive and Systematic Empirical Study

Qingyun Yang, Zejun Zhang, Dapeng Yan, Tian Zhang, Zhenchang Xing, Yi Li, Zhiming Liu

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

QINGYUN YANG, Nanjing University, China

ZEJUN ZHANG ∗^{*}, Nanjing University, China

DAPENG YAN, Nanjing University of Posts and Telecommunications, China

TIAN ZHANG, Nanjing University, China

ZHENCHANG XING, CSIRO's Data61, Australia

YI LI, Nanyang Technological University, Singapore

ZHIMING LIU, Southwest University, China

Code linters, tools that automatically detect code issues, help developers accelerate development and improve code quality by identifying errors early. Unlike previous studies that focused mainly on single linters or informal comparisons, this paper presents the first large-scale empirical study of five widely used Python linters: Ruff, Pylint, Flake8, Mypy and Black, through four key user concerns: linting rule checks, speed, configuration methods, and linter preferences. We analyze 1,551 linting rules, categorize them into five types, and construct rule mappings, finding that more than 40% are shared between multiple linters, with Ruff and Pylint together covering over 80% of all rules. Pylint has the most rules in the first two categories, and Ruff leads in the last three. Next, we measure their running times on 1,000 GitHub projects under three setups (single-rule, default, all-rules), finding a consistent speed ranking from fastest to slowest: Ruff, Mypy, Flake8, Black, and Pylint. Ruff is extremely fast, with runtimes typically within one second. Then, we summarize four configuration methods and four types of configuration options from 443 available options across the five linters. While all linters support the four configuration methods, they differ in project configuration formats and flexibility in their configuration options. Finally, an analysis of 3,094 GitHub projects using the five linters reveals that over 50% use multiple linters, share strong consensus on option selections and rule suppressions, but exhibit project-specific variations in enabled-rule configurations. Our findings provide actionable insights for linter users and establish a benchmark dataset and taxonomy to support future research, such as cross-linter rule mapping, performance modeling, and automated configuration.

Additional Key Words and Phrases: Python Linter, Linting Rule, Speed, Configuration, Preference

1 Introduction

Linters are automatic static analysis tools that detect code issues (e.g. stylistic issues and violations of coding standards) [34, 35, 51]. They play an important role in software development by improving developer efficiency, enforcing consistent coding practices, and ensuring code quality [37, 52]. To support different programming ecosystems, a variety of linters [2, 5, 6] are developed and widely used. For instance, Ruff and Pylint for Python, ESLint and JSHint for JavaScript.

Previous studies [28, 29, 31, 33–36, 40, 41, 43, 51, 52, 54–57] typically focus on how developers use a single linter but overlook a comparative analysis of linters about aspects where users face challenges, such as rule checks. With many linters available and little guidance on how to select and use linters, a systematic comparison is essential to help users make informed choices. However, such comparative study is labor-intensive, requiring deep familiarity with each tool and careful

∗^{*}Corresponding author.

Authors' Contact Information: Qingyun Yang, qingyun.yang@smail.nju.edu.cn, Nanjing University, Nanjing, Jiangsu, China; Zejun Zhang, zejun.zhang@nju.edu.cn, Nanjing University, Nanjing, Jiangsu, China; DAPENG YAN, dapeng.yan@njupt.edu.cn, Nanjing University of Posts and Telecommunications, Nanjing, Jiangsu, China; Tian Zhang, ztluck@nju.edu.cn, Nanjing University, Nanjing, Jiangsu, China; Zhenchang Xing, CSIRO's Data61, Canberra, Australia, zhenchang.xing@data61.csiro.au; Yi Li, yi_li@ntu.edu.sg, Nanyang Technological University, Singapore, Singapore; Zhiming Liu, zhimingliu88@swu.edu.cn, Southwest University, Chongqing, China.

Yang et al.

cross-linter comparison. For example, collecting, analyzing and comparing hundreds of linting rules across linters demands substantial manual effort. Tómasdóttir et al. [51] interviewed developers to understand the adoption of ESLint and found that users struggle to understand and choose rule checks. Their findings show the need for in-depth analysis of linting rules within a linter, let alone across multiple linters, further highlighting the necessity of such comparative study.

To systematically conduct the comparative study of linters, we first select five representative Python linters with high popularity and comprehensive rule coverage: Ruff [21], Pylint [17], Flake8 [7], Mypy [11], and Black [2]. We focus on Python linters due to Python's top ranking in popularity in recent years [1, 16]. Next, to understand the challenges users face when using linters, we examine discussions on Stack Overflow [25], which tend to focus on technical issues, and Reddit [14], which often reflects broader user experiences. We find that users are frequently confused by four aspects of these linters: rule checks, speed, configuration methods, and linter preferences. For example, due to the variety of linting rules across linters, a Stack Overflow user mistakenly believed that Mypy and Pylint cannot check undefined object [10]. In reality, Mypy excels at object usage and includes support for such checks. The result underscores the need to analyze and compare linters across these aspects, helping users correctly understand and utilize linters.

Motivated by these user concerns, our study about five Python linters addresses the following four research questions:

RQ1: What linting rules are enforced by Python linters? We first collect linting rules from linter official documentation [3, 8, 13, 19, 22] and then categorize them using a card sorting approach [49]. Among the 1,551 linting rules, 56% are unique to a single linter and no linting rules exist in all linters, reflecting linters have their distinctiveness. These rules fall into five categories: wrong syntax, wrong usage of objects, logical contradiction, style convention and best practice. Pylint has the most rules in the first two categories compared to other linters, and Ruff has the most rules in the last three. To maximize linting coverage with minimal linters, using only Ruff and Pylint can cover over 80% of linting rules. The large number of linting rules and their overlaps emphasize the importance of building linter interoperability to enable linters to work seamlessly together, reduce redundant checks and improve efficiency.

RQ2: What is the running time of Python linters on projects? To comprehensively assess the linter running time, we conduct three setups: enabling a single rule, default rules and all rules, corresponding to minimum, typical and maximum running time of linters, respectively. Based on rigorous runtime measurements on 1,000 GitHub projects under three setups, the linters consistently rank from fastest to slowest: Ruff, Mypy, Flake8, Black and Pylint, with runtimes of 5.1ms ~ 1s, 55.9ms ~ 2s, 50.3ms ~ 5.5s, 61.3ms ~ 33.7s, and 110.6ms ~ >1000s, respectively. Except for Black and Flake8, the running times of different rules exhibit significant differences, indicating that linter running time is affected by rule selection.

RQ3: How are Python linters configured? By analyzing linter official configuration documentation [4, 9, 12, 18, 23], we identify four common configuration methods: command line, project configuration files, dedicated configuration files, and inline configuration. All five linters support these methods, reflecting a shared emphasis on flexible integration into diverse development workflows. However, they differ in the formats of project configuration files. To further examine configuration flexibility, we collect 443 configuration options and categorize them into four types: environment setup, scope control, rule specification and result handling. Ruff, Pylint and Mypy each offer extensive category support, whereas Flake8 and Black offer only 25 options each, reflecting a more opinionated and minimalist design philosophy. Given the complexity of configuration methods and options across linters, users should consider the flexibility and level of control they need for their projects before selecting suitable linters.

RQ4: What are the preferences for selecting linters, configuring linters, and choosing linting rules across projects? We collect 3,094 GitHub projects using the five Python linters. Over 50%50\% of projects use multiple linters, reflecting a preference for comprehensive rule checks. Most projects using Ruff, Mypy, Flake8 and Black, prefer project configuration files, while projects using Pylint predominantly use dedicated configuration files. Projects' configuration option preferences focus primarily on rule specification, followed by scope control, whereas environment setup and result handling feature less prominently among commonly configured options. For linting rules, Black restricts enabling and disabling rules, reflecting its opinionated design. While enabling rules, most linters (Pylint, Flake8, Mypy) reflect project-specific preferences; when disabling, most linters (Ruff, Pylint, Flake8) show a consensus, focusing on suppressing style convention checks. This highlights the challenge of effectively using linters and emphasizes the importance of automatically recommending personalized rule selections and configurations based on project requirements.

The contributions of this paper are as follows:

  • To the best of our knowledge, this is the first large-scale qualitative and quantitative study that analyzes and compares linting rule checks, speed, configuration methods, and linter preferences across five Python linters.

  • Our analysis reveals unique characteristics of each linter in four aspects, showing that no single linter excels in all aspects.

  • We offer practical suggestions to help linter users select and use linters, and outline directions for future research.