Skip to content

Commit 7a10e21

Browse files
authored
Merge pull request #2988 from nateprewitt/pre-commit
Add pre-commit config
2 parents 2af248f + bbfbde9 commit 7a10e21

34 files changed

+247
-149
lines changed

.github/workflows/lint.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: Lint code
2+
3+
on:
4+
push:
5+
pull_request:
6+
branches-ignore: [ master ]
7+
8+
jobs:
9+
lint:
10+
runs-on: ubuntu-20.04
11+
12+
steps:
13+
- uses: actions/checkout@v2
14+
- name: Set up Python 3.9
15+
uses: actions/setup-python@v2
16+
with:
17+
python-version: 3.9
18+
- name: Run pre-commit
19+
uses: pre-commit/[email protected]

.github/workflows/run-tests.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
name: Run tests
32

43
on:

.pre-commit-config.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
exclude: ^(.github|.changes|docs/|boto3/compat.py|boto3/data)
2+
repos:
3+
- repo: https://github.com/pre-commit/pre-commit-hooks
4+
rev: v2.3.0
5+
hooks:
6+
- id: check-yaml
7+
- id: end-of-file-fixer
8+
- id: trailing-whitespace
9+
- repo: https://github.com/pycqa/flake8
10+
rev: 3.9.2
11+
hooks:
12+
- id: flake8

CHANGELOG.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8249,4 +8249,3 @@ CHANGELOG
82498249

82508250
* feature:Resources: Supports S3, EC2, SQS, SNS, and IAM resources
82518251
* feature:Clients: Supports low-level clients for most services
8252-

CODE_OF_CONDUCT.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,3 @@
22
This project has adopted the [Amazon Open Source Code of Conduct](https://aws.github.io/code-of-conduct).
33
For more information see the [Code of Conduct FAQ](https://aws.github.io/code-of-conduct-faq) or contact
44
[email protected] with any additional questions or comments.
5-

README.rst

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,10 @@ Assuming that you have Python and ``virtualenv`` installed, set up your environm
4949
5050
$ python -m pip install boto3
5151
52-
52+
5353
Using Boto3
5454
~~~~~~~~~~~~~~
55-
After installing boto3
55+
After installing boto3
5656

5757
Next, set up credentials (in e.g. ``~/.aws/credentials``):
5858

@@ -68,7 +68,7 @@ Then, set up a default region (in e.g. ``~/.aws/config``):
6868
6969
[default]
7070
region=us-east-1
71-
71+
7272
Other credentials configuration method can be found `here <https://boto3.amazonaws.com/v1/documentation/api/latest/guide/credentials.html>`__
7373

7474
Then, from a Python interpreter:
@@ -137,4 +137,3 @@ More Resources
137137
* `NOTICE <https://github.com/boto/boto3/blob/develop/NOTICE>`__
138138
* `Changelog <https://github.com/boto/boto3/blob/develop/CHANGELOG.rst>`__
139139
* `License <https://github.com/boto/boto3/blob/develop/LICENSE>`__
140-

boto3/compat.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ def _warn_deprecated_python():
7575
'aws-cli-v1/'
7676
}
7777
deprecated_versions = {
78-
(2,7): py_27_params,
78+
(2, 7): py_27_params,
7979
}
8080
py_version = sys.version_info[:2]
8181

boto3/docs/collection.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -185,11 +185,13 @@ def document_collection_method(section, resource_name, action_name,
185185
'method_description': (
186186
'Creates an iterable of all %s resources '
187187
'in the collection filtered by kwargs passed to '
188-
'method.' % collection_model.resource.type +
189-
'A %s collection will include all resources by '
188+
'method. A %s collection will include all resources by '
190189
'default if no filters are provided, and extreme '
191190
'caution should be taken when performing actions '
192-
'on all resources.'% collection_model.resource.type),
191+
'on all resources.' % (
192+
collection_model.resource.type,
193+
collection_model.resource.type
194+
)),
193195
'example_prefix': '%s_iterator = %s.%s.filter' % (
194196
xform_name(collection_model.resource.type),
195197
example_resource_name, collection_model.name),

boto3/dynamodb/conditions.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -144,8 +144,9 @@ def __init__(self, *values):
144144
AttributeBase.__init__(self, values[0].name)
145145

146146
def __eq__(self, other):
147-
return ConditionBase.__eq__(self, other) and \
148-
AttributeBase.__eq__(self, other)
147+
return (
148+
ConditionBase.__eq__(self, other) and AttributeBase.__eq__(self, other)
149+
)
149150

150151
def __ne__(self, other):
151152
return not self.__eq__(other)

scripts/ci/run-crt-tests

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ def run(command):
2929

3030

3131
try:
32-
import awscrt
32+
import awscrt # noqa
3333
except ImportError:
3434
print("MISSING DEPENDENCY: awscrt must be installed to run the crt tests.")
3535
sys.exit(1)

0 commit comments

Comments
 (0)