From 36ede4eb05c508b727e41a0f43cc3c88c7a94633 Mon Sep 17 00:00:00 2001 From: Wolfgang Müller Date: Fri, 15 Nov 2024 15:52:00 +0100 Subject: backend/lint: Do not shadow certain builtins This commit enables ruff's flake8-builtin linter that emits warnings when builtin functions are shadowed. This is useful for builtins like "dict", "list", or "str" which we use often. Given the nature of this program we historically rely a lot on the usage of "id", "hash", and "filter" as variable names which also shadow Python builtins. For now let's ignore those, we have not used any of them in our code and the impact to the codebase would be considerable. This might be revisited in the future. --- tests/scrapers/test_scraper.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tests/scrapers/test_scraper.py') diff --git a/tests/scrapers/test_scraper.py b/tests/scrapers/test_scraper.py index 8492425..d0cef7b 100644 --- a/tests/scrapers/test_scraper.py +++ b/tests/scrapers/test_scraper.py @@ -20,7 +20,7 @@ class NoneScraper(Scraper): class WarningScraper(Scraper): is_available = True - def warn(self, str): + def warn(self, msg): raise ScrapeWarning("Invalid input") def scrape(self): -- cgit v1.2.3-2-gb3c3