Enable flake8-comprehensions linting rules (#267)
See https://docs.astral.sh/ruff/rules/#flake8-comprehensions-c4.
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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):
|
||||
|
||||
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user