Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: gforcada/flake8-builtins
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 2.4.0
Choose a base ref
...
head repository: gforcada/flake8-builtins
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 2.5.0
Choose a head ref
  • 5 commits
  • 4 files changed
  • 2 contributors

Commits on Apr 1, 2024

  1. Back to development: 2.4.1

    gforcada committed Apr 1, 2024

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    5b6dbff View commit details

Commits on Apr 8, 2024

  1. feat(A005): support detecting a shadowing folder

    fix #124
    asfaltboy committed Apr 8, 2024
    Copy the full SHA
    74588e1 View commit details

Commits on Apr 9, 2024

  1. chore: add change note for shadow dir module

    asfaltboy committed Apr 9, 2024
    Copy the full SHA
    b46b4d7 View commit details
  2. Merge pull request #125 from asfaltboy/ps/import-a005-module-dir

    feat(A005): support detecting a shadowing folder
    gforcada authored Apr 9, 2024

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    3890afb View commit details
  3. Preparing release 2.5.0

    gforcada committed Apr 9, 2024
    Copy the full SHA
    ab45f4d View commit details
Showing with 13 additions and 2 deletions.
  1. +7 −0 CHANGES.rst
  2. +4 −1 flake8_builtins.py
  3. +1 −1 pyproject.toml
  4. +1 −0 run_tests.py
7 changes: 7 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
@@ -3,6 +3,13 @@
Changelog
=========

2.5.0 (2024-04-09)
------------------

- Support detecting a shadowing folder as module name (as part of `A005`).
[asfaltboy]


2.4.0 (2024-04-01)
------------------

5 changes: 4 additions & 1 deletion flake8_builtins.py
Original file line number Diff line number Diff line change
@@ -293,7 +293,10 @@ def check_module_name(self, filename: str):
if not self.module_names:
return
path = Path(filename)
module_name = path.name.removesuffix('.py')
if path.name == '__init__.py':
module_name = path.parent.name
else:
module_name = path.name.removesuffix('.py')
if module_name in self.module_names:
yield self.error(
None,
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"

[project]
name = "flake8-builtins"
version = "2.4.0"
version = "2.5.0"
authors = [
{ name="Gil Forcada Codinachs", email="gil.gnome@gmail.com" },
]
1 change: 1 addition & 0 deletions run_tests.py
Original file line number Diff line number Diff line change
@@ -510,6 +510,7 @@ def test_tuple_unpacking():
def test_module_name():
source = ''
check_code(source, expected_codes='A005', filename='./temp/logging.py')
check_code(source, expected_codes='A005', filename='./temp/typing/__init__.py')


@pytest.mark.skipif(