File tree Expand file tree Collapse file tree 4 files changed +69
-36
lines changed Expand file tree Collapse file tree 4 files changed +69
-36
lines changed Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1+ # Copyright 2022 Google LLC
2+ #
3+ # Licensed under the Apache License, Version 2.0 (the "License");
4+ # you may not use this file except in compliance with the License.
5+ # You may obtain a copy of the License at
6+ #
7+ # http://www.apache.org/licenses/LICENSE-2.0
8+ #
9+ # Unless required by applicable law or agreed to in writing, software
10+ # distributed under the License is distributed on an "AS IS" BASIS,
11+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+ # See the License for the specific language governing permissions and
13+ # limitations under the License.
14+
15+ name : Lint
16+ on : [pull_request]
17+
18+ jobs :
19+ build :
20+ name : Run lint
21+ runs-on : ubuntu-latest
22+ steps :
23+ - name : Setup Python
24+ uses : actions/setup-python@v3
25+ with :
26+ python-version : " 3.9"
27+
28+ - name : Install nox
29+ run : pip install nox
30+
31+ - name : Checkout code
32+ uses : actions/checkout@v3
33+
34+ - name : Run nox lint session
35+ run : nox --sessions lint
Original file line number Diff line number Diff line change 1+ # Copyright 2022 Google LLC
2+ #
3+ # Licensed under the Apache License, Version 2.0 (the "License");
4+ # you may not use this file except in compliance with the License.
5+ # You may obtain a copy of the License at
6+ #
7+ # http://www.apache.org/licenses/LICENSE-2.0
8+ #
9+ # Unless required by applicable law or agreed to in writing, software
10+ # distributed under the License is distributed on an "AS IS" BASIS,
11+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+ # See the License for the specific language governing permissions and
13+ # limitations under the License.
14+
15+ from __future__ import absolute_import
16+ import os
17+ import nox
18+
19+ BLACK_PATHS = ["iam_groups_authn" ]
20+
21+ if os .path .exists ("samples" ):
22+ BLACK_PATHS .append ("samples" )
23+
24+
25+ @nox .session
26+ def lint (session ):
27+ """Run linters.
28+ Returns a failure if the linters find linting errors or sufficiently
29+ serious code quality issues.
30+ """
31+ session .install ("-r" , "requirements-test.txt" )
32+ session .install ("-r" , "requirements.txt" )
33+ session .run ("black" , "--check" , * BLACK_PATHS )
Original file line number Diff line number Diff line change @@ -9,3 +9,4 @@ google-api-python-client==2.19.1
99cloud-sql-python-connector==0.4.1
1010google-cloud-logging==2.6.0
1111aiohttp==3.8.0
12+ black==22.3.0
You can’t perform that action at this time.
0 commit comments