CtrlK
BlogDocsLog inGet started
Tessl Logo

tessl/pypi-pylint

Comprehensive static code analysis tool for Python that performs deep code inspection without executing the program

Pending
Overview
Eval results
Files

built-in-checkers.mddocs/

Built-in Checkers

Comprehensive set of 78+ built-in checkers covering all aspects of Python code analysis. These checkers are automatically loaded and provide extensive static analysis capabilities for variables, imports, formatting, type checking, classes, design patterns, and specialized language features.

Capabilities

Core Analysis Checkers

Essential checkers that form the foundation of pylint's static analysis capabilities.

# Variable analysis
import pylint.checkers.variables
# - Unused variables and imports
# - Undefined variables
# - Variable redefinition
# - Global variable usage

# Import analysis  
import pylint.checkers.imports
# - Import order and grouping
# - Circular imports
# - Unused imports
# - Relative import usage

# Basic code analysis
import pylint.checkers.base
# - Unreachable code
# - Dangerous default arguments
# - Lost exception context
# - Assert statements on tuples

Code Style and Formatting

Checkers that enforce coding standards and formatting conventions.

# Format and style checking
import pylint.checkers.format
# - Line length limits
# - Indentation consistency  
# - Trailing whitespace
# - Blank line usage
# - Operator spacing

# Method and function arguments
import pylint.checkers.method_args
# - Duplicate argument names
# - Missing required arguments
# - Keyword argument validation
# - *args and **kwargs usage

Type System Analysis

Advanced type checking and inference validation.

# Type checking and inference
import pylint.checkers.typecheck
# - Attribute access validation
# - Method call validation
# - Type compatibility checking
# - Iterator and sequence validation

# String usage analysis
import pylint.checkers.strings
# - String formatting validation
# - Quote consistency
# - String concatenation patterns
# - Format string validation

Object-Oriented Programming

Checkers focused on class definitions, inheritance, and OOP patterns.

# Class analysis
import pylint.checkers.classes
# - Method resolution order
# - Abstract method implementation
# - Class attribute access
# - Special method implementation

# New-style class features
import pylint.checkers.newstyle
# - Property usage
# - Descriptor validation
# - Metaclass usage
# - Class decoration

Exception Handling

Analysis of exception handling patterns and error management.

# Exception handling analysis
import pylint.checkers.exceptions
# - Bare except clauses
# - Exception hierarchy validation
# - Exception chaining
# - Finally clause usage
# - Exception message validation

Design and Architecture

High-level design analysis and architectural pattern validation.

# Design analysis
import pylint.checkers.design_analysis
# - Cyclomatic complexity
# - Class coupling metrics
# - Method/class size limits
# - Inheritance depth analysis
# - Interface segregation

Refactoring Suggestions

Checkers that identify opportunities for code improvement and refactoring.

# Refactoring opportunities
import pylint.checkers.refactoring
# - Simplifiable conditions
# - Unnecessary loops
# - Redundant code patterns
# - Boolean expression simplification
# - Consider using enumerate/zip

Standard Library Usage

Validation of Python standard library usage patterns and best practices.

# Standard library validation
import pylint.checkers.stdlib
# - Deprecated standard library usage
# - Incorrect API usage patterns
# - Performance anti-patterns
# - Security concerns in stdlib usage

Logging Analysis

Specialized analysis for logging usage patterns and best practices.

# Logging usage analysis
import pylint.checkers.logging
# - Logging format string validation
# - Logger configuration checking
# - Log level consistency
# - Logging performance patterns

Modern Python Features

Checkers for contemporary Python language features and patterns.

# Async/await pattern analysis
import pylint.checkers.async_
# - Async function usage
# - Await expression validation
# - Async context manager usage
# - Async iterator patterns

# Threading and concurrency
import pylint.checkers.threading
# - Thread safety analysis
# - Lock usage patterns
# - Shared state validation
# - Race condition detection

Code Quality Metrics

Specialized checkers for code quality assessment and metrics collection.

# Unicode and encoding
import pylint.checkers.unicode
# - Encoding declaration validation
# - Unicode string handling
# - Character encoding issues

# Spelling validation
import pylint.checkers.spelling
# - Comment and docstring spelling
# - Variable name spelling
# - Configurable dictionaries
# - Technical term validation

Similarity Detection

Detection of code duplication and similar patterns.

# Code similarity analysis
import pylint.checkers.symilar
# - Duplicate code detection
# - Similar structure identification
# - Configurable similarity thresholds
# - Cross-file duplication checking

Checker Categories

Convention (C) Messages

Code style and convention violations that don't affect functionality.

# Examples of convention messages:
# C0103: invalid-name - Name doesn't conform to naming convention
# C0111: missing-docstring - Missing module/class/function docstring  
# C0301: line-too-long - Line exceeds maximum length limit
# C0326: bad-whitespace - Wrong whitespace usage

Refactor (R) Messages

Suggestions for code improvements and refactoring opportunities.

# Examples of refactor messages:
# R0201: no-self-use - Method could be a function
# R0903: too-few-public-methods - Class has too few public methods
# R0913: too-many-arguments - Function has too many arguments
# R1705: no-else-return - Unnecessary else after return

Warning (W) Messages

Potential issues that might cause problems but aren't definite errors.

# Examples of warning messages:
# W0613: unused-argument - Unused function argument
# W0622: redefined-builtin - Redefining built-in function
# W0703: broad-except - Catching too general exception
# W1203: logging-fstring-interpolation - Use lazy % formatting in logging

Error (E) Messages

Probable bugs and definite code errors.

# Examples of error messages:
# E0601: used-before-assignment - Using variable before assignment
# E1101: no-member - Instance has no member
# E1120: no-value-for-parameter - No value provided for required parameter
# E1136: unsubscriptable-object - Value is not subscriptable

Fatal (F) Messages

Errors that prevent pylint from continuing analysis.

# Examples of fatal messages:
# F0001: fatal - Error occurred preventing further processing
# F0010: error - Error in configuration or parsing
# F0202: method-check-failed - Unable to check method signature

Usage Examples

Enabling/Disabling Specific Checkers

from pylint.lint import PyLinter

linter = PyLinter()

# Disable specific checkers
linter.config.disable = ['missing-docstring', 'invalid-name']

# Enable only specific categories
linter.config.disable = 'all'
linter.config.enable = ['error', 'fatal']

# Configure specific checker options
linter.config.max_line_length = 120
linter.config.good_names = ['i', 'j', 'k', 'x', 'y', 'z']

Programmatic Checker Configuration

# Configure variable naming patterns
linter.config.variable_rgx = r'[a-z_][a-z0-9_]{2,30}$'
linter.config.const_rgx = r'(([A-Z_][A-Z0-9_]*)|(__.*__))$'
linter.config.class_rgx = r'[A-Z_][a-zA-Z0-9]+$'

# Configure complexity limits
linter.config.max_complexity = 10
linter.config.max_args = 5
linter.config.max_locals = 15
linter.config.max_branches = 12

# Configure import checking
linter.config.import_graph = True
linter.config.ext_import_graph = True
linter.config.int_import_graph = True

Custom Message Filtering

# Filter messages by category
def filter_messages(message):
    # Only show errors and fatals
    return message.category in ['E', 'F']

# Filter messages by pattern
import re
def filter_by_pattern(message):
    # Skip messages about test files
    return not re.search(r'test_.*\.py', message.path)

Checker-Specific Configuration

Variable Checker Options

# Variable naming and usage configuration
variable_rgx = r'[a-z_][a-z0-9_]{2,30}$'  # Variable name pattern
const_rgx = r'(([A-Z_][A-Z0-9_]*)|(__.*__))$'  # Constant pattern
good_names = ['i', 'j', 'k', 'x', 'y', 'z']  # Accepted short names
bad_names = ['foo', 'bar', 'baz']  # Forbidden names

Import Checker Options

# Import analysis configuration
deprecated_modules = ['optparse', 'imp']  # Modules to flag as deprecated
import_graph = True  # Generate import dependency graph
ext_import_graph = True  # Include external dependencies
preferred_modules = {'collections': 'collections.abc'}  # Preferred imports

Format Checker Options

# Code formatting configuration
max_line_length = 100  # Maximum line length
indent_string = '    '  # Indentation string (4 spaces)
indent_after_paren = 4  # Indentation after parenthesis
single_line_if_stmt = False  # Allow single-line if statements
single_line_class_stmt = False  # Allow single-line class statements

Install with Tessl CLI

npx tessl i tessl/pypi-pylint

docs

built-in-checkers.md

checker-development.md

configuration.md

core-linting.md

extensions.md

index.md

messages.md

pyreverse.md

reporters.md

test-utilities.md

tile.json