Skip to content

Commit 725ff93

Browse files
authored
Merge pull request #130 from tremblaysimon/bugfix/gh-129-line-number-zero
fix: default line number and column offset to 1
2 parents 5484162 + a1e30cd commit 725ff93

File tree

6 files changed

+16
-13
lines changed

6 files changed

+16
-13
lines changed

.github/workflows/testing.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,15 @@ jobs:
1212
runs-on: "ubuntu-latest"
1313
strategy:
1414
matrix:
15-
python-version: ["3.12", "3.11", "3.10", 3.9, 3.8, pypy-3.9]
15+
python-version: ["3.12", "3.11", "3.10", 3.9, pypy-3.9]
1616
steps:
1717
- uses: actions/checkout@v4
1818
- name: Set up Python
19-
uses: actions/setup-python@v4
19+
uses: actions/setup-python@v5
2020
with:
2121
python-version: ${{ matrix.python-version }}
2222
- name: Cache packages
23-
uses: actions/cache@v3
23+
uses: actions/cache@v4
2424
with:
2525
path: ~/.cache/pip
2626
key: ${{ runner.os }}-pip-${{ matrix.python-version }}-${{ hashFiles('tox.ini') }}
@@ -36,15 +36,15 @@ jobs:
3636
runs-on: "ubuntu-latest"
3737
strategy:
3838
matrix:
39-
python-version: [3.8]
39+
python-version: [3.12]
4040
steps:
4141
- uses: actions/checkout@v4
4242
- name: Set up Python
43-
uses: actions/setup-python@v4
43+
uses: actions/setup-python@v5
4444
with:
4545
python-version: ${{ matrix.python-version }}
4646
- name: Cache packages
47-
uses: actions/cache@v3
47+
uses: actions/cache@v4
4848
with:
4949
path: |
5050
~/.cache/pre-commit

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@
55
.coverage
66
.installed.cfg
77
.hypothesis
8+
.tox
89
bin
910
develop-eggs
1011
include
1112
lib
13+
venv

README.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ to ignore a custom list of builtins::
8383

8484
Requirements
8585
------------
86-
- Python 3.8, 3.9, 3.10, 3.11, 3.12, and pypy3
86+
- Python 3.9, 3.10, 3.11, 3.12, and pypy3
8787
- flake8
8888

8989
Rules

flake8_builtins.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@ class BuiltinsChecker:
1717
module_name_msg = 'A005 the module is shadowing a Python builtin module "{0}"'
1818
lambda_argument_msg = 'A006 lambda argument "{0}" is shadowing a Python builtin'
1919

20+
default_line_number = 1
21+
default_column_offset = 1
22+
2023
names = []
2124
ignore_list = {
2225
'__name__',
@@ -283,8 +286,8 @@ def error(self, statement=None, variable=None, message=None):
283286

284287
# lineno and col_offset must be integers
285288
return (
286-
statement.lineno if statement else 0,
287-
statement.col_offset if statement else 0,
289+
statement.lineno if statement else self.default_line_number,
290+
statement.col_offset if statement else self.default_column_offset,
288291
message.format(variable),
289292
type(self),
290293
)

pyproject.toml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ authors = [
1111
description = "Check for python builtins being used as variables or parameters"
1212
keywords = ["pep8", "flake8", "python", ]
1313
readme = "README.rst"
14-
requires-python = ">=3.8"
14+
requires-python = ">=3.9"
1515
classifiers = [
1616
"Development Status :: 5 - Production/Stable",
1717
"Environment :: Console",
@@ -22,7 +22,6 @@ classifiers = [
2222
"Programming Language :: Python",
2323
"Programming Language :: Python :: 3",
2424
"Programming Language :: Python :: 3 :: Only",
25-
"Programming Language :: Python :: 3.8",
2625
"Programming Language :: Python :: 3.9",
2726
"Programming Language :: Python :: 3.10",
2827
"Programming Language :: Python :: 3.11",
@@ -49,7 +48,7 @@ A00 = "flake8_builtins:BuiltinsChecker"
4948
profile = "plone"
5049

5150
[tool.black]
52-
target-version = ["py38"]
51+
target-version = ["py312"]
5352
skip-string-normalization = true
5453

5554
[tool.check-manifest]

tox.ini

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ envlist =
44
format
55
lint
66
coverage
7-
py38
87
py39
98
py310
109
py311

0 commit comments

Comments
 (0)