-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add some helper tooling for dev and docs
Also, reformat with black and fix a few ruff findings.
- Loading branch information
Showing
12 changed files
with
1,140 additions
and
42 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
This file was deleted.
Oops, something went wrong.
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,25 @@ | ||
name: CI | ||
|
||
on: | ||
# Triggers the workflow on push or pull request events but only for the "main" branch | ||
push: | ||
branches: [ "main" ] | ||
pull_request: | ||
branches: [ "main" ] | ||
|
||
# Allows you to run this workflow manually from the Actions tab | ||
workflow_dispatch: | ||
|
||
jobs: | ||
tox: | ||
name: Run Tox | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Run all envs | ||
uses: fedora-python/tox-github-action@main | ||
with: | ||
tox_env: ${{ matrix.tox_env }} | ||
strategy: | ||
matrix: | ||
tox_env: [black, ruff, schema] | ||
runs-on: ubuntu-latest |
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 |
---|---|---|
@@ -1 +1,3 @@ | ||
.cache | ||
*.egg-info/ | ||
.tox |
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,9 @@ | ||
[tool.black] | ||
line-length = 100 | ||
|
||
[tool.ruff] | ||
line-length = 100 | ||
|
||
[tool.ruff.lint] | ||
# https://beta.ruff.rs/docs/rules/ | ||
select = ["F", "E", "W", "I", "N"] |
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,3 @@ | ||
black | ||
check-jsonschema | ||
ruff |
Large diffs are not rendered by default.
Oops, something went wrong.
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 @@ | ||
mkdocs-material[imaging] |
Large diffs are not rendered by default.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
import json | ||
import itertools | ||
import json | ||
import secrets | ||
import sys | ||
|
||
|
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,19 @@ | ||
[tox] | ||
envlist = black, ruff, schema | ||
|
||
[testenv:black] | ||
deps = -r requirements/dev-requirements.txt | ||
commands = black --check . | ||
|
||
[testenv:ruff] | ||
deps = -r requirements/dev-requirements.txt | ||
commands = ruff check . | ||
|
||
[testenv:schema] | ||
deps = -r requirements/dev-requirements.txt | ||
allowlist_externals = bash | ||
commands = | ||
bash -c 'for example in {tox_root}/sbom/examples/*/*.json; do \ | ||
echo "$example"; \ | ||
check-jsonschema --schemafile sbom/spdx-2.3-schema.json "$example"; \ | ||
done' |