skillfed

flake8-plugin-utils

The package provides base classes and utils for flake8 plugin writing

flake8-plugin-utils v1.3.3 961.3K downloads/30d#4,634 on PyPI18
Permissive license MIT DORMANT released

What it is and what it does

flake8-plugin-utils is a framework for building flake8 linter plugins. It provides base classes (Error, Visitor, Plugin) that abstract away boilerplate code needed to integrate with flake8's plugin system, letting you focus on the AST traversal logic. The package includes testing utilities (assert_error, assert_not_error) to validate your plugin rules, configuration support for parameterizing plugin behavior, and helper functions for common AST operations like checking node equivalence and identifying literal values.

The package is designed for developers writing custom flake8 checkers. You define error types, implement visitor methods to detect violations, and the framework handles registration with flake8 and option parsing. It supports type-safe configuration through generics and includes utilities for comparing AST nodes, which is useful when your rules need to detect duplicate or equivalent code patterns.

Use it for:

  • Build a custom flake8 plugin to enforce project-specific code style or naming conventions
  • Create a linter plugin that detects anti-patterns or problematic code structures in your codebase
  • Write a flake8 plugin that checks for security issues or compliance violations in Python code
  • Test your flake8 plugin rules with pytest using the built-in assert_error and assert_not_error helpers
  • Develop a plugin that requires configuration options, using the config system to parameterize checks

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Provides base classes and utilities for writing flake8 plugins, including Error, Visitor, and Plugin abstractions with built-in testing helpers and AST node utilities.

Yes, if you are writing a flake8 plugin. The package significantly reduces boilerplate and provides a clean API for plugin development. Dormant maintenance is acceptable here because the API is stable and unlikely to need frequent updates; flake8's plugin interface changes rarely. No known vulnerabilities. Low install friction and permissive license add no friction.

Install

flake8-plugin-utils on PyPI

pip

pip install flake8-plugin-utils

uv

uv add flake8-plugin-utils

poetry

poetry add flake8-plugin-utils

Installing flake8-plugin-utils

Before you install

Low install friction with no runtime dependencies. Maintenance is dormant—last release was 2023-06-26 and no commits since 2024-01-01—but the package is stable and widely used (961264 monthly downloads).

License in practice

MIT license (permissive) places no restrictions on use, modification, or distribution in proprietary or open-source projects.

Quickstart

from flake8_plugin_utils import Error, Visitor, Plugin

class MyError(Error):
    code = 'X100'
    message = 'my error'

class MyVisitor(Visitor):
    def visit_ClassDef(self, node):
        self.error_from_node(MyError, node)

class MyPlugin(Plugin):
    name = 'MyPlugin'
    version = '0.1.0'
    visitors = [MyVisitor]

Verify before relying

  • Whether dormant maintenance status poses a risk for future Python or flake8 compatibility changes
  • Whether the package is actively maintained despite no recent commits

Package facts

License MIT (permissive)
Python support supports the current Python release (>=3.6,<4.0)
Install friction low — pure-Python wheel
Runtime dependencies none
Maintenance dormant — 1,145 days since the last release
Last repo commit
First released
Downloads 961,264/month — #4,634 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: flake8_plugin_utils-1.3.3-py3-none-any.whl

Keywords: flake8, plugin, utils

License :: OSI Approved :: MIT LicenseProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.6Programming Language :: Python :: 3.7Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9

Tags

flake8 plugin developmentflake8 plugin base classeswrite flake8 pluginsflake8 plugin testingflake8 visitor patternAST node utilitiesflake8 plugin framework
flake8-pluginast-utilitiescode-linting

More Quality Assurance packages