Skip to content

Commit d367c4a

Browse files
committed
#24 add linting
1 parent 940d102 commit d367c4a

File tree

43 files changed

+956
-57
lines changed

Some content is hidden

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

43 files changed

+956
-57
lines changed

.config/.editorconfig

Lines changed: 367 additions & 0 deletions
Large diffs are not rendered by default.

.github/workflows/bandit.yaml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: bandit
2+
3+
on:
4+
pull_request:
5+
branches: [main]
6+
7+
permissions:
8+
contents: read
9+
pull-requests: write
10+
11+
jobs:
12+
bandit:
13+
runs-on: ubuntu-latest
14+
strategy:
15+
fail-fast: false
16+
matrix:
17+
python-version: ["3.12"]
18+
19+
steps:
20+
- name: Checkout repository
21+
uses: actions/checkout@v4
22+
23+
- name: Set up Python ${{ matrix.python-version }}
24+
uses: actions/setup-python@v5
25+
with:
26+
python-version: ${{ matrix.python-version }}
27+
28+
- name: Run Bandit Scan
29+
uses: lukehinds/bandit-action@new-action
30+
env:
31+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
32+
with:
33+
path: "examples src"
34+
recursive: "true"

.github/workflows/bearer.yaml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: bearer
2+
3+
on:
4+
push:
5+
branches-ignore: [main]
6+
pull_request:
7+
branches: [main]
8+
9+
permissions:
10+
contents: read
11+
12+
jobs:
13+
rule_check:
14+
runs-on: ubuntu-latest
15+
16+
steps:
17+
- uses: actions/checkout@v4
18+
19+
- name: Bearer
20+
uses: bearer/bearer-action@v2

.github/workflows/black.yaml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: black
2+
3+
on: [push, pull_request]
4+
5+
permissions:
6+
contents: read
7+
8+
jobs:
9+
black:
10+
name: black Python ${{ matrix.python-version }}
11+
runs-on: ubuntu-latest
12+
strategy:
13+
fail-fast: false
14+
matrix:
15+
python-version: ["3.9", "3.10", "3.11", "3.12"]
16+
17+
steps:
18+
- name: Checkout repository
19+
uses: actions/checkout@v4
20+
21+
- name: Set up Python ${{ matrix.python-version }}
22+
uses: actions/setup-python@v5
23+
with:
24+
python-version: ${{ matrix.python-version }}
25+
26+
- name: Install dependencies
27+
run: |
28+
python -m venv ./venv
29+
source ./venv/bin/activate
30+
echo "PATH=${PATH}" >> "${GITHUB_ENV}"
31+
python -m pip install --upgrade pip
32+
python -m pip install --requirement requirements.txt
33+
python -m pip install black
34+
35+
- name: Run black testing
36+
run: |
37+
# shellcheck disable=SC2046
38+
black --diff --check $(git ls-files '*.py' ':!:docs/source/*')
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Check development dependencies
2+
3+
on: [pull_request]
4+
5+
permissions:
6+
contents: read
7+
8+
jobs:
9+
check-development-dependencies:
10+
name: Check development dependencies
11+
runs-on: ubuntu-latest
12+
strategy:
13+
fail-fast: false
14+
matrix:
15+
python-version: ["3.12"]
16+
17+
steps:
18+
- name: Checkout repository
19+
uses: actions/checkout@v4
20+
21+
- name: Set up Python ${{ matrix.python-version }}
22+
uses: actions/setup-python@v5
23+
with:
24+
python-version: ${{ matrix.python-version }}
25+
26+
- name: Install dependencies
27+
run: |
28+
python -m venv ./venv
29+
source ./venv/bin/activate
30+
echo "PATH=${PATH}" >> "${GITHUB_ENV}"
31+
python -m pip install --upgrade pip
32+
python -m pip install --requirement development-requirements.txt
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
name: Dependency scan
2+
3+
on:
4+
pull_request:
5+
branches: [main]
6+
7+
permissions:
8+
contents: read
9+
10+
jobs:
11+
fpvs:
12+
runs-on: ubuntu-latest
13+
strategy:
14+
fail-fast: false
15+
matrix:
16+
python-version: ["3.12"]
17+
18+
steps:
19+
- name: Checkout repository
20+
uses: actions/checkout@v4
21+
22+
- name: Set up Python ${{ matrix.python-version }}
23+
uses: actions/setup-python@v5
24+
with:
25+
python-version: ${{ matrix.python-version }}
26+
27+
- name: Install dependencies
28+
run: |
29+
python -m venv ./venv
30+
source ./venv/bin/activate
31+
echo "PATH=${PATH}" >> "${GITHUB_ENV}"
32+
python -m pip install --upgrade pip
33+
python -m pip install --requirement requirements.txt
34+
python -m pip install wheel
35+
python -m pip wheel -r requirements.txt --wheel-dir=vendor
36+
37+
- name: Run fpvs scan
38+
run: |
39+
python -m pip install fpvs
40+
git clone https://gitlab.com/gitlab-org/security-products/gemnasium-db.git
41+
fpvs-scan --verbose
42+
43+
pip-audit:
44+
runs-on: ubuntu-latest
45+
strategy:
46+
fail-fast: false
47+
matrix:
48+
python-version: ["3.12"]
49+
50+
steps:
51+
- name: Checkout repository
52+
uses: actions/checkout@v4
53+
54+
- name: Set up Python ${{ matrix.python-version }}
55+
uses: actions/setup-python@v5
56+
with:
57+
python-version: ${{ matrix.python-version }}
58+
59+
- name: Install dependencies
60+
run: |
61+
python -m venv ./venv
62+
source ./venv/bin/activate
63+
echo "PATH=${PATH}" >> "${GITHUB_ENV}"
64+
python -m pip install --requirement requirements.txt
65+
python -m pip install .
66+
67+
- name: Run pip-audit
68+
uses: pypa/[email protected]
69+
with:
70+
inputs: requirements.txt
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: dotnet format
2+
3+
on:
4+
push:
5+
branches-ignore: [main]
6+
pull_request:
7+
branches: [main]
8+
9+
permissions:
10+
contents: read
11+
12+
jobs:
13+
dotnet-format:
14+
runs-on: ubuntu-latest
15+
strategy:
16+
matrix:
17+
include:
18+
- dotnet-version: "8"
19+
20+
steps:
21+
- name: checkout repository
22+
uses: actions/checkout@v4
23+
with:
24+
fetch-depth: 0
25+
26+
- uses: actions/setup-dotnet@v4
27+
with:
28+
dotnet-version: ${{ matrix.dotnet-version }}
29+
30+
- name: dotnet format all
31+
run: |
32+
dotnet restore
33+
dotnet format --verify-no-changes --verbosity diagnostic

.github/workflows/flake8.yaml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: flake8
2+
3+
on: [push, pull_request]
4+
5+
permissions:
6+
contents: read
7+
8+
jobs:
9+
flake8:
10+
name: flake8 Python ${{ matrix.python-version }}
11+
runs-on: ubuntu-latest
12+
strategy:
13+
fail-fast: false
14+
matrix:
15+
python-version: ["3.9", "3.10", "3.11", "3.12"]
16+
17+
steps:
18+
- name: Checkout repository
19+
uses: actions/checkout@v4
20+
21+
- name: Set up Python ${{ matrix.python-version }}
22+
uses: actions/setup-python@v5
23+
with:
24+
python-version: ${{ matrix.python-version }}
25+
26+
- name: Run flake8 lint
27+
uses: py-actions/flake8@v2
28+
with:
29+
max-line-length: 88
30+
path: src
31+
plugins: flake8-black

.github/workflows/isort.yaml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: isort
2+
3+
on: [push, pull_request]
4+
5+
permissions:
6+
contents: read
7+
8+
jobs:
9+
isort:
10+
runs-on: ubuntu-latest
11+
strategy:
12+
fail-fast: false
13+
matrix:
14+
python-version: ["3.12"]
15+
16+
steps:
17+
- name: Checkout repository
18+
uses: actions/checkout@v4
19+
20+
- name: Set up Python ${{ matrix.python-version }}
21+
uses: actions/setup-python@v5
22+
with:
23+
python-version: ${{ matrix.python-version }}
24+
25+
- name: Install dependencies
26+
run: |
27+
python -m venv ./venv
28+
source ./venv/bin/activate
29+
echo "PATH=${PATH}" >> "${GITHUB_ENV}"
30+
python -m pip install --upgrade pip
31+
python -m pip install --requirement requirements.txt
32+
33+
- name: Run isort
34+
uses: isort/isort-action@v1
35+
with:
36+
requirements-files: requirements.txt
37+
sort-paths: "examples src/template_python tests"

.github/workflows/java-darwin-snippets.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ jobs:
3636
SENZING_DIR: "/opt/senzing/er"
3737
run: |
3838
cd "${GITHUB_WORKSPACE}"/java
39-
mvn clean install
39+
mvn clean install -Pcheckstyle,spotbugs -B -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn
4040
4141
- name: run java snippets
4242
env:

0 commit comments

Comments
 (0)