-
Notifications
You must be signed in to change notification settings - Fork 136
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #205 from nateprewitt/pre-commit
Add pre-commit config
- Loading branch information
Showing
33 changed files
with
257 additions
and
100 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
name: Lint code | ||
|
||
on: | ||
push: | ||
pull_request: | ||
branches-ignore: [ master ] | ||
|
||
jobs: | ||
lint: | ||
runs-on: ubuntu-20.04 | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Set up Python 3.9 | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: 3.9 | ||
- name: Run pre-commit | ||
uses: pre-commit/[email protected] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
exclude: ^(.changes/|CHANGELOG.rst) | ||
repos: | ||
- repo: https://github.com/pre-commit/pre-commit-hooks | ||
rev: v4.0.1 | ||
hooks: | ||
- id: check-yaml | ||
- id: end-of-file-fixer | ||
- id: trailing-whitespace | ||
- repo: https://github.com/pycqa/flake8 | ||
rev: 3.9.2 | ||
hooks: | ||
- id: flake8 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
Contributing Code | ||
----------------- | ||
A good pull request: | ||
|
||
- Is clear. | ||
- Works across all supported versions of Python. | ||
- Follows the existing style of the code base (see Codestyle section). | ||
- Has comments included as needed. | ||
|
||
- A test case that demonstrates the previous flaw that now passes with | ||
the included patch, or demonstrates the newly added feature. | ||
- If it adds/changes a public API, it must also include documentation | ||
for those changes. | ||
- Must be appropriately licensed (Apache 2.0). | ||
|
||
Reporting An Issue/Feature | ||
-------------------------- | ||
First, check to see if there's an existing | ||
`issue <https://github.com/boto/botocore/issues>`__/`pull requests <https://github.com/boto/botocore/pulls>`__ for the bug/feature. | ||
|
||
If there isn't an existing issue there, please file an issue *first*. The | ||
ideal report includes: | ||
|
||
- A description of the problem/suggestion. | ||
- How to recreate the bug. | ||
- If relevant, including the versions of your: | ||
|
||
- Python interpreter | ||
- s3transfer | ||
- Optionally of the other dependencies involved (e.g. Botocore) | ||
|
||
- If possible, create a pull request with a (failing) test case | ||
demonstrating what's wrong. This makes the process for fixing bugs | ||
quicker & gets issues resolved sooner. | ||
|
||
Codestyle | ||
--------- | ||
This project uses flake8 to enforce codstyle requirements. We've codified this | ||
process using a tool called `pre-commit <https://pre-commit.com/>`__. pre-commit | ||
allows us to specify a config file with all tools required for code linting, | ||
and surfaces either a git commit hook, or single command, for enforcing these. | ||
|
||
To validate your PR prior to publishing, you can use the following | ||
`installation guide <https://pre-commit.com/#install>`__ to setup pre-commit. | ||
|
||
If you don't want to use the git commit hook, you can run the below command | ||
to automatically perform the codestyle validation: | ||
|
||
.. code-block:: bash | ||
$ pre-commit run | ||
This will automatically perform simple updates (such as white space clean up) | ||
and provide a list of any failing flake8 checks. After these are addressed, | ||
you can commit the changes prior to publishing the PR. | ||
These checks are also included in our CI setup under the "Lint" workflow which will provide output on Github for anything missed locally. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.