Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 9fcf66b

Browse files
authored
Start using auto-formatters (#754)
Use black to auto-format the style so it's always consistent and pyupgrade will allow us to auto-upgrade to the newest language features.
1 parent 78543ff commit 9fcf66b

89 files changed

Lines changed: 4499 additions & 3583 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/pythonpackage.yml

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@ name: Build and Test Bandit
33
on: [push, pull_request]
44

55
jobs:
6-
pylint:
6+
format:
77
runs-on: ubuntu-latest
88
strategy:
99
matrix:
10-
python-version: [3.5]
10+
python-version: [3.6]
1111
steps:
1212
- uses: actions/checkout@v1
1313
- name: Set up Python ${{ matrix.python-version }}
@@ -21,13 +21,13 @@ jobs:
2121
pip install -r test-requirements.txt
2222
pip install tox
2323
- name: Run tox
24-
run: tox -e pylint
24+
run: tox -e format
2525

2626
pep8:
2727
runs-on: ubuntu-latest
2828
strategy:
2929
matrix:
30-
python-version: [3.5]
30+
python-version: [3.6]
3131
steps:
3232
- uses: actions/checkout@v1
3333
- name: Set up Python ${{ matrix.python-version }}
@@ -43,11 +43,11 @@ jobs:
4343
- name: Run tox
4444
run: tox -e pep8
4545

46-
py35:
46+
py36:
4747
runs-on: ubuntu-latest
4848
strategy:
4949
matrix:
50-
python-version: [3.5]
50+
python-version: [3.6]
5151
steps:
5252
- uses: actions/checkout@v1
5353
- name: Set up Python ${{ matrix.python-version }}
@@ -61,13 +61,13 @@ jobs:
6161
pip install -r test-requirements.txt
6262
pip install tox
6363
- name: Run tox
64-
run: tox -e py35
64+
run: tox -e py36
6565

66-
py36:
66+
py37:
6767
runs-on: ubuntu-latest
6868
strategy:
6969
matrix:
70-
python-version: [3.6]
70+
python-version: [3.7]
7171
steps:
7272
- uses: actions/checkout@v1
7373
- name: Set up Python ${{ matrix.python-version }}
@@ -81,13 +81,13 @@ jobs:
8181
pip install -r test-requirements.txt
8282
pip install tox
8383
- name: Run tox
84-
run: tox -e py36
84+
run: tox -e py37
8585

86-
py37:
86+
py38:
8787
runs-on: ubuntu-latest
8888
strategy:
8989
matrix:
90-
python-version: [3.7]
90+
python-version: [3.8]
9191
steps:
9292
- uses: actions/checkout@v1
9393
- name: Set up Python ${{ matrix.python-version }}
@@ -101,13 +101,13 @@ jobs:
101101
pip install -r test-requirements.txt
102102
pip install tox
103103
- name: Run tox
104-
run: tox -e py37
104+
run: tox -e py38
105105

106-
py38:
106+
py39:
107107
runs-on: ubuntu-latest
108108
strategy:
109109
matrix:
110-
python-version: [3.8]
110+
python-version: [3.9]
111111
steps:
112112
- uses: actions/checkout@v1
113113
- name: Set up Python ${{ matrix.python-version }}
@@ -121,13 +121,13 @@ jobs:
121121
pip install -r test-requirements.txt
122122
pip install tox
123123
- name: Run tox
124-
run: tox -e py38
124+
run: tox -e py39
125125

126-
py39:
126+
py310:
127127
runs-on: ubuntu-latest
128128
strategy:
129129
matrix:
130-
python-version: [3.9]
130+
python-version: ['3.10']
131131
steps:
132132
- uses: actions/checkout@v1
133133
- name: Set up Python ${{ matrix.python-version }}
@@ -141,4 +141,4 @@ jobs:
141141
pip install -r test-requirements.txt
142142
pip install tox
143143
- name: Run tox
144-
run: tox -e py39
144+
run: tox -e py310

.pre-commit-config.yaml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
exclude: ^(examples|tools|doc|releasenotes)
2+
repos:
3+
- repo: https://github.com/pre-commit/pre-commit-hooks
4+
rev: v4.0.1
5+
hooks:
6+
- id: check-yaml
7+
- id: debug-statements
8+
- id: end-of-file-fixer
9+
- id: trailing-whitespace
10+
- repo: https://github.com/asottile/reorder_python_imports
11+
rev: v2.6.0
12+
hooks:
13+
- id: reorder-python-imports
14+
args: [--application-directories, '.:src', --py36-plus]
15+
- repo: https://github.com/psf/black
16+
rev: 21.10b0
17+
hooks:
18+
- id: black
19+
args: [--line-length=79, --target-version=py36]
20+
- repo: https://github.com/asottile/pyupgrade
21+
rev: v2.29.0
22+
hooks:
23+
- id: pyupgrade
24+
args: [--py36-plus]
25+
- repo: https://github.com/jorisroovers/gitlint
26+
rev: v0.16.0
27+
hooks:
28+
- id: gitlint
29+
#- repo: https://github.com/pre-commit/mirrors-mypy
30+
# rev: v0.910-1
31+
# hooks:
32+
# - id: mypy
33+
# exclude: ^(docs/|example-plugin/)

CONTRIBUTING.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Contributing to Bandit
2-
Thanks for considering to take part in the improvement of the Bandit project. Contributions are always welcome!
2+
Thanks for considering to take part in the improvement of the Bandit project. Contributions are always welcome!
33
Here are guidelines and rules that can be helpful if you plan to want to get involved in the project.
44

55
#### Table Of Contents
@@ -27,7 +27,7 @@ If you encounter a bug, please let us know about it. See the guide here [GitHub
2727
to add a comment to the existing issue instead of creating a new one.
2828

2929
### Submitting your first issue
30-
We encourage using the issue template to improve quality of reported issues.
30+
We encourage using the issue template to improve quality of reported issues.
3131
Navigate to the issues tab and select `New issue`, then select the **Bug report** template and fill out the form.
3232
To submit a good bug report keep in mind to:
3333
* Use a descriptive title so other people can understand what the issue is about.

LICENSE

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,4 +173,3 @@
173173
defend, and hold each Contributor harmless for any liability
174174
incurred by, or claims asserted against, such Contributor by reason
175175
of your accepting any such warranty or additional liability.
176-

bandit/__init__.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
1-
# -*- coding:utf-8 -*-
21
#
32
# Copyright 2014 Hewlett-Packard Development Company, L.P.
43
#
54
# SPDX-License-Identifier: Apache-2.0
6-
75
import pbr.version
86

97
from bandit.core import config # noqa
@@ -18,4 +16,4 @@
1816
from bandit.core.issue import * # noqa
1917
from bandit.core.test_properties import * # noqa
2018

21-
__version__ = pbr.version.VersionInfo('bandit').version_string()
19+
__version__ = pbr.version.VersionInfo("bandit").version_string()

bandit/__main__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,5 @@
1313
https://bandit.readthedocs.io/
1414
"""
1515
from bandit.cli import main
16+
1617
main.main()

0 commit comments

Comments
 (0)