Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions .github/workflows/testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@ jobs:
runs-on: "ubuntu-latest"
strategy:
matrix:
python-version: ["3.12", "3.11", "3.10", 3.9, 3.8, pypy-3.9]
python-version: ["3.12", "3.11", "3.10", 3.9, pypy-3.9]
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Cache packages
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ matrix.python-version }}-${{ hashFiles('tox.ini') }}
Expand All @@ -36,15 +36,15 @@ jobs:
runs-on: "ubuntu-latest"
strategy:
matrix:
python-version: [3.8]
python-version: [3.12]
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Cache packages
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: |
~/.cache/pre-commit
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@
.coverage
.installed.cfg
.hypothesis
.tox
bin
develop-eggs
include
lib
venv
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ to ignore a custom list of builtins::

Requirements
------------
- Python 3.8, 3.9, 3.10, 3.11, 3.12, and pypy3
- Python 3.9, 3.10, 3.11, 3.12, and pypy3
- flake8

Rules
Expand Down
7 changes: 5 additions & 2 deletions flake8_builtins.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ class BuiltinsChecker:
module_name_msg = 'A005 the module is shadowing a Python builtin module "{0}"'
lambda_argument_msg = 'A006 lambda argument "{0}" is shadowing a Python builtin'

default_line_number = 1
default_column_offset = 1

names = []
ignore_list = {
'__name__',
Expand Down Expand Up @@ -283,8 +286,8 @@ def error(self, statement=None, variable=None, message=None):

# lineno and col_offset must be integers
return (
statement.lineno if statement else 0,
statement.col_offset if statement else 0,
statement.lineno if statement else self.default_line_number,
statement.col_offset if statement else self.default_column_offset,
message.format(variable),
type(self),
)
Expand Down
5 changes: 2 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ authors = [
description = "Check for python builtins being used as variables or parameters"
keywords = ["pep8", "flake8", "python", ]
readme = "README.rst"
requires-python = ">=3.8"
requires-python = ">=3.9"
classifiers = [
"Development Status :: 5 - Production/Stable",
"Environment :: Console",
Expand All @@ -22,7 +22,6 @@ classifiers = [
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
Expand All @@ -49,7 +48,7 @@ A00 = "flake8_builtins:BuiltinsChecker"
profile = "plone"

[tool.black]
target-version = ["py38"]
target-version = ["py312"]
skip-string-normalization = true

[tool.check-manifest]
Expand Down
1 change: 0 additions & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ envlist =
format
lint
coverage
py38
py39
py310
py311
Expand Down