Skip to content

Commit

Permalink
Selectively disable linting for docs/custom_conf.py
Browse files Browse the repository at this point in the history
Re-enable linting for docs/custom_conf.py (removing global noqa), but
selectively disable tests that fail, as much of this code is based on
sphinx-docs-starter-pack/custom_conf.py, which does not use the same
linting as this project.
  • Loading branch information
james-garner-canonical committed Aug 22, 2024
1 parent aa7e9e7 commit c3f4fad
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
3 changes: 1 addition & 2 deletions docs/custom_conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.

# ruff: noqa
import datetime
import pathlib
import sys
Expand Down Expand Up @@ -100,7 +99,7 @@ def _compute_navigation_tree(context):
# -H 'Accept: application/vnd.github.v3.raw' \
# https://api.github.com/repos/canonical/<REPO> | jq '.created_at'

copyright = '%s, %s' % (datetime.date.today().year, author)
copyright = '%s, %s' % (datetime.date.today().year, author) # noqa: A001

## Open Graph configuration - defines what is displayed as a link preview
## when linking to the documentation from another website (see https://ogp.me/)
Expand Down
11 changes: 11 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,7 @@ ignore = [
# Unnecessary `tuple` call (rewrite as a literal)
"C408",
]

[tool.ruff.lint.per-file-ignores]
"test/*" = [
# All documentation linting.
Expand All @@ -181,6 +182,16 @@ ignore = [
"S605", # Starting a process with a shell: seems safe, but may be changed in the future; consider rewriting without `shell`
"S607", # Starting a process with a partial executable path
]
"docs/custom_conf.py" = [
"D100", # Missing docstring in public module
"D101", # Missing docstring in public class
"D102", # Missing docstring in public method
"D103", # Missing docstring in public function
"E266", # Too many leading `#` before block comment
"I001", # Import block is un-sorted or un-formatted
"RUF003", # Comment contains ambiguous unicode characters (EN DASH, RIGHT SINGLE QUOTATION MARK)
"UP031", # Use format specifiers instead of percent format
]

[tool.ruff.lint.pydocstyle]
convention = "google"
Expand Down

0 comments on commit c3f4fad

Please sign in to comment.