Enable more ruff rules

Change-Id: Ife8ecbb9c411c475c346cdf1616f2e766d0d6527
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
This commit is contained in:
Stephen Finucane committed 2026-01-09 14:56:50 +00:00
1 parent ea114834c4
commit f66ef5f741
7 files changed
+12 -13

No files matched your search

+3 -3
View File
@@ -13,13 +13,13 @@ repos:
- id: check-yaml
files: .*\.(yaml|yml)$
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.13.0
rev: v0.14.11
hooks:
- id: ruff
- id: ruff-check
args: ['--fix']
- id: ruff-format
- repo: https://opendev.org/openstack/hacking
rev: 7.0.0
rev: 8.0.0
hooks:
- id: hacking
additional_dependencies: []
-1
View File
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
# Copyright (C) 2020 Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
-1
View File
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
# Copyright (C) 2020 Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
+5 -6
View File
@@ -319,10 +319,8 @@ def _get_series_name():
def _setup_link_roles(app):
series = _get_series_name()
for project_name in app.config.openstackdocs_projects:
url = 'https://docs.openstack.org/{}/{}/%s'.format(
project_name, series
)
role_name = '{}-doc'.format(project_name)
url = f'https://docs.openstack.org/{project_name}/{series}/%s'
role_name = f'{project_name}-doc'
logger.debug(
'[openstackdocstheme] adding role %s to link to %s',
role_name,
@@ -439,8 +437,9 @@ def _config_inited(app, config):
doc_parts = os.path.abspath(app.srcdir).split(os.sep)[-2:]
if doc_parts[0] in ('api-guide', 'api-ref', 'releasenotes'):
logger.debug(
f'[openstackdocstheme] auto-versioning disabled (doc name '
f'contains {doc_parts[0]}'
'[openstackdocstheme] auto-versioning disabled (doc name '
'contains %s)',
doc_parts[0],
)
auto_version = False
else:
+3
View File
@@ -47,3 +47,6 @@ line-length = 79
[tool.ruff.format]
quote-style = "preserve"
docstring-code-format = true
[tool.ruff.lint]
select = ["E4", "E5", "E7", "E9", "F", "G", "LOG", "UP"]
-1
View File
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
+1 -1
View File
@@ -82,7 +82,7 @@ deps = bindep
commands = bindep test
[flake8]
exclude=.venv,.git,.tox,dist,doc,api-ref,*lib/python*,*egg,tools
exclude = .venv,.git,.tox,dist,doc,api-ref,*lib/python*,*egg,tools
show-source = True
# We only enable the hacking (H) checks
select = H