diff --git a/.ruff.toml b/.ruff.toml index 351bfed4..076063a0 100644 --- a/.ruff.toml +++ b/.ruff.toml @@ -4,6 +4,7 @@ select = [ "ASYNC", # flake8-async "B", # flake8-bugbear "BLE", # flake8-blind-except + "C4", # flake8-comprehensions "C90", # mccabe "COM", # flake8-commas "E", # pycodestyle errors diff --git a/report.py b/report.py index a68c3bc7..5f5f5510 100755 --- a/report.py +++ b/report.py @@ -8,7 +8,7 @@ products = {} count = 0 count_auto = 0 products_dir = sys.argv[1] if len(sys.argv) > 1 else 'website/products/' -for product_file in sorted(list(glob(f'{products_dir}/*.md'))): +for product_file in sorted(glob(f'{products_dir}/*.md')): with open(product_file) as f: data = frontmatter.load(f) count += 1 diff --git a/src/php.py b/src/php.py index cf3bc700..7508895d 100644 --- a/src/php.py +++ b/src/php.py @@ -7,8 +7,7 @@ print(f"::group::{product.name}") # Fetch major versions latest_by_major = http.fetch_url(MAIN_URL).json() -major_versions = [major for major in latest_by_major] -major_version_urls = [f"{MAIN_URL}&version={major_version}" for major_version in major_versions] +major_version_urls = [f"{MAIN_URL}&version={major_version}" for major_version in latest_by_major] # Fetch all versions for major versions for major_versions_response in http.fetch_urls(major_version_urls): diff --git a/src/splunk.py b/src/splunk.py index 07b9159e..76be78f1 100644 --- a/src/splunk.py +++ b/src/splunk.py @@ -35,7 +35,7 @@ print(f"::group::{product.name}") main = http.fetch_url("https://docs.splunk.com/Documentation/Splunk") soup = BeautifulSoup(main.text, features="html5lib") -all_versions = list(map(lambda option: option.attrs['value'], soup.select("select#version-select > option"))) +all_versions = [option.attrs['value'] for option in soup.select("select#version-select > option")] # Latest minor release notes contains release notes for all previous minor versions. # For example, 9.0.5 release notes also contains release notes for 9.0.0 to 9.0.4.