Skip to content

Commit

Permalink
Merge pull request #1361 from pradyunsg/linting
Browse files Browse the repository at this point in the history
Bump linters and add ruff for consistent formatting across the codebase
  • Loading branch information
pradyunsg committed Nov 8, 2023
2 parents 2b84f3e + b305711 commit 74c509f
Show file tree
Hide file tree
Showing 4 changed files with 130 additions and 107 deletions.
1 change: 1 addition & 0 deletions .git-blame-ignore-revs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
1d7b1abd152e4cb5e6a46e52e6b7e3bf8d366486
8 changes: 7 additions & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
rev: v4.5.0
hooks:
- id: check-added-large-files
- id: check-case-conflict
Expand Down Expand Up @@ -31,3 +31,9 @@ repos:
- id: rst-backticks
- id: rst-directive-colons
- id: rst-inline-touching-normal

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.1.4
hooks:
- id: ruff
- id: ruff-format
35 changes: 22 additions & 13 deletions noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
# Attribution-ShareAlike license:
# http://creativecommons.org/licenses/by-sa/3.0.

import shutil

import nox

Expand All @@ -19,10 +18,12 @@ def translation(session):
target_dir = "locales"
session.run(
"sphinx-build",
"-b", "gettext", # build gettext-style message catalogs (.pot file)
"-d", session.cache_dir / ".doctrees", # path to put the cache
"-b",
"gettext", # build gettext-style message catalogs (.pot file)
"-d",
session.cache_dir / ".doctrees", # path to put the cache
"source/", # where the rst files are located
target_dir, # where to put the .pot file
target_dir, # where to put the .pot file
)


Expand All @@ -45,10 +46,14 @@ def build(session, autobuild=False):
)

session.run(
command, *extra_args,
"-j", "auto", # parallelize the build
"-b", "html", # use HTML builder
"-d", session.cache_dir / ".doctrees", # path to put the cache
command,
*extra_args,
"-j",
"auto", # parallelize the build
"-b",
"html", # use HTML builder
"-d",
session.cache_dir / ".doctrees", # path to put the cache
"-n", # nitpicky warn about all missing references
"-W", # Treat warnings as errors.
*session.posargs,
Expand All @@ -74,12 +79,16 @@ def linkcheck(session):
session.install("-r", "requirements.txt")
session.run(
"sphinx-build",
"-b", "linkcheck", # use linkcheck builder
"-d", session.cache_dir / ".doctrees", # path to put the cache
"-b",
"linkcheck", # use linkcheck builder
"-d",
session.cache_dir / ".doctrees", # path to put the cache
"--color",
"-n", "-W", "--keep-going", # be strict
"source", # where the rst files are located
"build", # where to put the check output
"-n",
"-W",
"--keep-going", # be strict
"source", # where the rst files are located
"build", # where to put the check output
)


Expand Down

0 comments on commit 74c509f

Please sign in to comment.