2626
2727import nox
2828
29-
3029RUFF_VERSION = "ruff==0.14.14"
3130
3231LINT_PATHS = ["google" , "tests" , "noxfile.py" , "setup.py" ]
@@ -85,23 +84,27 @@ def lint(session):
8584
8685 # 2. Check formatting
8786 session .run (
88- "ruff" , "format" ,
87+ "ruff" ,
88+ "format" ,
8989 "--check" ,
9090 f"--target-version=py{ ALL_PYTHON [0 ].replace ('.' , '' )} " ,
91- "--line-length=88" ,
91+ "--line-length=88" ,
9292 * LINT_PATHS ,
9393 )
9494
9595
9696@nox .session (python = DEFAULT_PYTHON_VERSION )
9797def blacken (session ):
9898 """(Deprecated) Legacy session. Please use 'nox -s format'."""
99- session .log ("WARNING: The 'blacken' session is deprecated and will be removed in a future release. Please use 'nox -s format' in the future." )
100-
99+ session .log (
100+ "WARNING: The 'blacken' session is deprecated and will be removed in a future release. Please use 'nox -s format' in the future."
101+ )
102+
101103 # Just run the ruff formatter (keeping legacy behavior of only formatting, not sorting imports)
102104 session .install (RUFF_VERSION )
103105 session .run (
104- "ruff" , "format" ,
106+ "ruff" ,
107+ "format" ,
105108 f"--target-version=py{ ALL_PYTHON [0 ].replace ('.' , '' )} " ,
106109 "--line-length=88" ,
107110 * LINT_PATHS ,
@@ -535,8 +538,10 @@ def format(session):
535538 # check --select I: Enables strict import sorting
536539 # --fix: Applies the changes automatically
537540 session .run (
538- "ruff" , "check" ,
539- "--select" , "I" ,
541+ "ruff" ,
542+ "check" ,
543+ "--select" ,
544+ "I" ,
540545 "--fix" ,
541546 f"--target-version=py{ ALL_PYTHON [0 ].replace ('.' , '' )} " ,
542547 "--line-length=88" , # Standard Black line length
@@ -545,7 +550,8 @@ def format(session):
545550
546551 # 3. Run Ruff to format code
547552 session .run (
548- "ruff" , "format" ,
553+ "ruff" ,
554+ "format" ,
549555 f"--target-version=py{ ALL_PYTHON [0 ].replace ('.' , '' )} " ,
550556 "--line-length=88" , # Standard Black line length
551557 * LINT_PATHS ,
0 commit comments