diff --git a/.ruff.toml b/.ruff.toml index 58583973..ab42bb65 100644 --- a/.ruff.toml +++ b/.ruff.toml @@ -17,9 +17,10 @@ select = [ "N", # pep8-naming "PIE", # flake8-pie "PGH", # pygrep-hooks - "SLF", # flake8-self "RET", # flake8-return "RUF100", # unused noqa (yesqa) + "SLF", # flake8-self + "SIM", # flake8-simplify "T10", # flake8-debugger "UP", # pyupgrade "W", # pycodestyle warnings diff --git a/latest.py b/latest.py index 36b31db3..4ee0b89c 100644 --- a/latest.py +++ b/latest.py @@ -117,7 +117,7 @@ class Product: def check_latest(self) -> None: for release in self.releases: latest = release.latest() - if release.matched and latest not in self.versions.keys(): + if release.matched and latest not in self.versions: logging.info(f"latest version {latest} for {release.name} not found in {self.versions_path}") def process_version(self, version: str, date_str: str) -> None: diff --git a/src/apple.py b/src/apple.py index 74c35833..9e1ea413 100644 --- a/src/apple.py +++ b/src/apple.py @@ -55,7 +55,7 @@ print("::group::apple") soups = [BeautifulSoup(response.text, features="html5lib") for response in http.fetch_urls(URLS)] print("::endgroup::") -for product_name in VERSION_PATTERNS.keys(): +for product_name in VERSION_PATTERNS: product = endoflife.Product(product_name) print(f"::group::{product.name}") diff --git a/src/common/endoflife.py b/src/common/endoflife.py index 9346f428..0998d729 100644 --- a/src/common/endoflife.py +++ b/src/common/endoflife.py @@ -59,7 +59,7 @@ class ProductFrontmatter: if "auto" in self.data: for config in self.data["auto"]: - if method in config.keys(): + if method in config: configs.append(AutoConfig(method, config)) else: logging.error(f"mixed auto-update methods declared for {self.name}, this is not yet supported") @@ -154,7 +154,7 @@ def list_products(method: str, products_filter: str = None) -> list[str]: with open(product_file) as f: data = frontmatter.load(f) if "auto" in data: - matching_configs = list(filter(lambda config: method in config.keys(), data["auto"])) + matching_configs = list(filter(lambda config: method in config, data["auto"])) if len(matching_configs) > 0: products.append(product_name)