diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml index 79f07ff..dfedb25 100644 --- a/.github/workflows/testing.yml +++ b/.github/workflows/testing.yml @@ -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') }} @@ -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 diff --git a/.gitignore b/.gitignore index f85267e..ee5ed84 100644 --- a/.gitignore +++ b/.gitignore @@ -5,7 +5,9 @@ .coverage .installed.cfg .hypothesis +.tox bin develop-eggs include lib +venv \ No newline at end of file diff --git a/README.rst b/README.rst index c0e4f02..c301905 100644 --- a/README.rst +++ b/README.rst @@ -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 diff --git a/flake8_builtins.py b/flake8_builtins.py index e95d1db..d20b158 100644 --- a/flake8_builtins.py +++ b/flake8_builtins.py @@ -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__', @@ -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), ) diff --git a/pyproject.toml b/pyproject.toml index ea31ea5..ee7f930 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -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", @@ -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", @@ -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] diff --git a/tox.ini b/tox.ini index 5e582ec..7a37acf 100644 --- a/tox.ini +++ b/tox.ini @@ -4,7 +4,6 @@ envlist = format lint coverage - py38 py39 py310 py311