File tree Expand file tree Collapse file tree
packages/google-cloud-spanner Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -117,23 +117,34 @@ def lint(session):
117117 Returns a failure if the linters find linting errors or sufficiently
118118 serious code quality issues.
119119 """
120- session .install (FLAKE8_VERSION , BLACK_VERSION )
120+ session .install (FLAKE8_VERSION , RUFF_VERSION )
121+ # Check formatting
121122 session .run (
122- "black" ,
123+ "ruff" ,
124+ "format" ,
123125 "--check" ,
126+ f"--target-version=py{ ALL_PYTHON [0 ].replace ('.' , '' )} " ,
127+ "--line-length=88" ,
124128 * LINT_PATHS ,
125129 )
130+
126131 session .run ("flake8" , "google" , "tests" )
127132
128133
129134# Use a python runtime which is available in the owlbot post processor here
130135# https://github.com/googleapis/synthtool/blob/master/docker/owlbot/python/Dockerfile
131136@nox .session (python = DEFAULT_PYTHON_VERSION )
132137def blacken (session ):
133- """Run black. Format code to uniform standard."""
134- session .install (BLACK_VERSION )
138+ """(Deprecated) Legacy session. Please use 'nox -s format'."""
139+ session .log (
140+ "WARNING: The 'blacken' session is deprecated and will be removed in a future release. Please use 'nox -s format' in the future."
141+ )
142+ session .install (RUFF_VERSION )
135143 session .run (
136- "black" ,
144+ "ruff" ,
145+ "format" ,
146+ f"--target-version=py{ ALL_PYTHON [0 ].replace ('.' , '' )} " ,
147+ "--line-length=88" ,
137148 * LINT_PATHS ,
138149 )
139150
You can’t perform that action at this time.
0 commit comments