-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Nathan Weinberg <[email protected]>
- Loading branch information
1 parent
4db7bc1
commit 99146f1
Showing
23 changed files
with
1,291 additions
and
0 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,21 @@ | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
# GitHub Dependabot configuration file | ||
version: 2 | ||
updates: | ||
|
||
# Maintain dependencies for GitHub Actions | ||
- package-ecosystem: "github-actions" | ||
directory: "/" | ||
schedule: | ||
interval: "daily" | ||
- package-ecosystem: "docker" | ||
directory: "/.github/workflows" | ||
schedule: | ||
interval: "daily" | ||
|
||
# Maintain dependencies for Python scripts | ||
- package-ecosystem: "pip" | ||
directory: "/" | ||
schedule: | ||
interval: "daily" |
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 @@ | ||
# Since dependabot cannot update workflows using docker, | ||
# we use this indirection since dependabot can update this file. | ||
FROM rhysd/actionlint:1.7.1@sha256:435ecdb63b1169e80ca3e136290072548c07fc4d76a044cf5541021712f8f344 |
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,48 @@ | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
name: Lint GitHub Actions workflows | ||
on: | ||
push: | ||
branches: | ||
- "main" | ||
paths: | ||
- '.github/workflows/*.ya?ml' | ||
- '.github/workflows/actionlint.*' # This workflow | ||
pull_request: | ||
branches: | ||
- "main" | ||
paths: | ||
- '.github/workflows/*.ya?ml' | ||
- '.github/workflows/actionlint.*' # This workflow | ||
|
||
env: | ||
LC_ALL: en_US.UTF-8 | ||
|
||
defaults: | ||
run: | ||
shell: bash | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
actionlint: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: "Harden Runner" | ||
uses: step-security/harden-runner@f086349bfa2bd1361f7909c78558e816508cdc10 # v2.8.0 | ||
with: | ||
egress-policy: audit # TODO: change to 'egress-policy: block' after couple of runs | ||
|
||
- name: "Checkout" | ||
uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: "Download actionlint" | ||
run: | | ||
docker build --tag actionlint - < .github/workflows/actionlint.dockerfile | ||
- name: "Check workflow files" | ||
run: | | ||
echo "::add-matcher::.github/workflows/matchers/actionlint.json" | ||
docker run --volume="${PWD}:/repo" --workdir=/repo actionlint -color |
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,46 @@ | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
name: Lint Markdown documents | ||
|
||
on: | ||
push: | ||
branches: | ||
- "main" | ||
paths: | ||
- '**/*.md' | ||
- '.markdownlint-cli2.yaml' | ||
- '.github/workflows/docs.yml' # This workflow | ||
pull_request: | ||
branches: | ||
- "main" | ||
paths: | ||
- '**/*.md' | ||
- '.markdownlint-cli2.yaml' | ||
- '.github/workflows/docs.yml' # This workflow | ||
|
||
env: | ||
LC_ALL: en_US.UTF-8 | ||
|
||
defaults: | ||
run: | ||
shell: bash | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
markdown-lint: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: "Harden Runner" | ||
uses: step-security/harden-runner@f086349bfa2bd1361f7909c78558e816508cdc10 # v2.8.0 | ||
with: | ||
egress-policy: audit # TODO: change to 'egress-policy: block' after couple of runs | ||
- name: "Checkout" | ||
uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6 | ||
with: | ||
fetch-depth: 0 | ||
- name: "Check Markdown documents" | ||
uses: DavidAnson/markdownlint-cli2-action@b4c9feab76d8025d1e83c653fa3990936df0e6c8 # v16.0.0 | ||
with: | ||
globs: '**/*.md' |
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,67 @@ | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
name: Lint, Format, and MyPy | ||
|
||
on: | ||
push: | ||
branches: | ||
- "main" | ||
- "release-**" | ||
paths: | ||
- '**.py' | ||
- 'pyproject.toml' | ||
- 'requirements*.txt' | ||
- 'tox.ini' | ||
- 'scripts/*.sh' | ||
- '.github/**' | ||
pull_request: | ||
branches: | ||
- "main" | ||
- "release-**" | ||
paths: | ||
- '**.py' | ||
- 'pyproject.toml' | ||
- 'requirements*.txt' | ||
- 'tox.ini' | ||
- 'scripts/*.sh' | ||
- '.github/**' | ||
|
||
env: | ||
PYTHON_VERSION: 3.11 | ||
|
||
jobs: | ||
lint: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
# https://github.com/actions/checkout/issues/249 | ||
fetch-depth: 0 | ||
submodules: true | ||
|
||
- name: Setup Python 3.11 | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: 3.11 | ||
cache: pip | ||
cache-dependency-path: | | ||
**/pyproject.toml | ||
**/requirements*.txt | ||
- name: Install dependencies | ||
id: deps | ||
run: | | ||
python -m pip install --upgrade pip | ||
python -m pip install tox | ||
- name: Run Ruff check | ||
run: | | ||
tox -e ruff -- check | ||
- name: Run linting | ||
if: ${{ !cancelled() && (steps.deps.outcome == 'success') }} | ||
run: | | ||
echo "::add-matcher::.github/workflows/matchers/pylint.json" | ||
tox -e lint | ||
- name: Run mypy type checks | ||
if: ${{ !cancelled() && (steps.deps.outcome == 'success') }} | ||
run: | | ||
tox -e mypy |
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,17 @@ | ||
{ | ||
"problemMatcher": [ | ||
{ | ||
"owner": "actionlint", | ||
"pattern": [ | ||
{ | ||
"regexp": "^(?:\\x1b\\[\\d+m)?(.+?)(?:\\x1b\\[\\d+m)*:(?:\\x1b\\[\\d+m)*(\\d+)(?:\\x1b\\[\\d+m)*:(?:\\x1b\\[\\d+m)*(\\d+)(?:\\x1b\\[\\d+m)*: (?:\\x1b\\[\\d+m)*(.+?)(?:\\x1b\\[\\d+m)* \\[(.+?)\\]$", | ||
"file": 1, | ||
"line": 2, | ||
"column": 3, | ||
"message": 4, | ||
"code": 5 | ||
} | ||
] | ||
} | ||
] | ||
} |
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,32 @@ | ||
{ | ||
"problemMatcher": [ | ||
{ | ||
"owner": "pylint-error", | ||
"severity": "error", | ||
"pattern": [ | ||
{ | ||
"regexp": "^(.+):(\\d+):(\\d+):\\s(([EF]\\d{4}):\\s.+)$", | ||
"file": 1, | ||
"line": 2, | ||
"column": 3, | ||
"message": 4, | ||
"code": 5 | ||
} | ||
] | ||
}, | ||
{ | ||
"owner": "pylint-warning", | ||
"severity": "warning", | ||
"pattern": [ | ||
{ | ||
"regexp": "^(.+):(\\d+):(\\d+):\\s(([CRW]\\d{4}):\\s.+)$", | ||
"file": 1, | ||
"line": 2, | ||
"column": 3, | ||
"message": 4, | ||
"code": 5 | ||
} | ||
] | ||
} | ||
] | ||
} |
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,45 @@ | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
name: Spellcheck | ||
|
||
on: | ||
push: | ||
branches: | ||
- "main" | ||
paths: | ||
- '**.md' | ||
- '.github/workflows/spellcheck.yml' # This workflow | ||
pull_request: | ||
branches: | ||
- "main" | ||
paths: | ||
- '**.md' | ||
- '.github/workflows/spellcheck.yml' # This workflow | ||
|
||
env: | ||
LC_ALL: en_US.UTF-8 | ||
|
||
defaults: | ||
run: | ||
shell: bash | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
spellcheck: | ||
name: Spellcheck (en_US) | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: "Harden Runner" | ||
uses: step-security/harden-runner@f086349bfa2bd1361f7909c78558e816508cdc10 # v2.8.0 | ||
with: | ||
egress-policy: audit # TODO: change to 'egress-policy: block' after couple of runs | ||
|
||
- name: "Checkout" | ||
uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Spellcheck | ||
uses: rojopolis/spellcheck-github-actions@e36f662b21ead3f6f29794ac5c35069bf236463c # v0.37.0 |
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 |
---|---|---|
|
@@ -129,6 +129,7 @@ venv/ | |
ENV/ | ||
env.bak/ | ||
venv.bak/ | ||
dictionary.dic | ||
|
||
# Spyder project settings | ||
.spyderproject | ||
|
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,10 @@ | ||
[settings] | ||
profile=black | ||
from_first=true | ||
import_heading_future=Future | ||
import_heading_stdlib=Standard | ||
import_heading_thirdparty=Third Party | ||
import_heading_firstparty=First Party | ||
import_heading_localfolder=Local | ||
known_firstparty= | ||
known_localfolder=tuning |
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,15 @@ | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
config: | ||
line-length: false | ||
no-emphasis-as-header: false | ||
first-line-heading: false | ||
code-block-style: false | ||
no-duplicate-header: false | ||
single-trailing-newline: false | ||
globs: | ||
- "**/*.md" | ||
ignores: | ||
- ".github/**" | ||
- "venv/**" | ||
- ".venv/**" |
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,16 @@ | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
repos: | ||
- repo: https://github.com/PyCQA/isort | ||
rev: 5.11.5 | ||
hooks: | ||
- id: isort | ||
exclude: imports | ||
- repo: https://github.com/astral-sh/ruff-pre-commit | ||
# Ruff version. | ||
rev: v0.3.4 | ||
hooks: | ||
# Run the linter (most fixers are disabled for now). | ||
- id: ruff | ||
# Run the formatter. | ||
- id: ruff-format |
Oops, something went wrong.