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