-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 15e5ce4
Showing
18 changed files
with
1,404 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,19 @@ | ||
# SPDX-FileCopyrightText: Copyright DB InfraGO AG and contributors | ||
# SPDX-License-Identifier: CC0-1.0 | ||
rules: | ||
body-leading-blank: [2, always] | ||
footer-leading-blank: [2, always] | ||
scope-case: [2, always, lower-case] | ||
subject-case: [2, always, sentence-case] | ||
subject-empty: [2, never] | ||
subject-full-stop: [2, never, .] | ||
subject-max-length: [2, always, 72] | ||
type-empty: [2, never] | ||
type-enum: | ||
[ | ||
2, | ||
always, | ||
[build, chore, ci, docs, feat, fix, merge, perf, refactor, revert, test], | ||
] | ||
extends: | ||
- '@commitlint/config-conventional' |
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,7 @@ | ||
Copyright DB InfraGO AG and contributors | ||
SPDX-License-Identifier: CC0-1.0 | ||
|
||
node: $Format:%H$ | ||
node-date: $Format:%cI$ | ||
describe-name: $Format:%(describe:tags=true)$ | ||
ref-names: $Format:%D$ |
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,20 @@ | ||
|
||
# type(scope)[!]: <subject> (max 50 chars, capitalize, do not end with period) | ||
# Conventional Commits: https://www.conventionalcommits.org/en/v1.0.0/#summary | ||
# Seven rules of commits: https://chris.beams.io/posts/git-commit/#seven-rules | ||
# | ||
# Commit types: | ||
# - build (anything related to the package build) | ||
# - chore (cosmetic commits without behavioral changes to production code) | ||
# - ci (anything related to the CI setup) | ||
# - docs (anything related to the documentation) | ||
# - feat (new feature) | ||
# - fix (bug fix) | ||
# - merge (merge commit) | ||
# - perf (performance improvements) | ||
# - refactor (improvements without externally visible behavior changes) | ||
# - revert (other commit(s) was/were reverted) | ||
# - test (only changes to the test setup) | ||
# | ||
# Commit scopes: | ||
# - docstring |
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,2 @@ | ||
# Copyright DB InfraGO AG and contributors | ||
# SPDX-License-Identifier: Apache-2.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 |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# Copyright DB InfraGO AG and contributors | ||
# SPDX-License-Identifier: CC0-1.0 | ||
|
||
* text=auto | ||
|
||
*.{cmd,[cC][mM][dD]} text eol=crlf | ||
*.{bat,[bB][aA][tT]} text eol=crlf | ||
|
||
*.{sh,py} text eol=lf | ||
|
||
.git_archival.txt export-subst |
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,73 @@ | ||
# Copyright DB InfraGO AG and contributors | ||
# SPDX-License-Identifier: CC0-1.0 | ||
|
||
name: Code QA | ||
|
||
on: | ||
pull_request: | ||
push: | ||
branches: [master] | ||
tags: ["v*.*.*"] | ||
workflow_dispatch: | ||
|
||
jobs: | ||
pre-commit: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-python@v5 | ||
with: | ||
cache: pip | ||
cache-dependency-path: pyproject.toml | ||
python-version: "3.8" | ||
- name: Upgrade pip | ||
run: python -m pip install -U pip | ||
- name: Install pre-commit | ||
run: python -m pip install pre-commit | ||
- name: Run Pre-Commit | ||
run: pre-commit run --all-files | ||
|
||
build: | ||
name: Build wheel | ||
runs-on: ubuntu-latest | ||
needs: [pre-commit] | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
- name: Setup Python | ||
uses: actions/setup-python@v5 | ||
with: | ||
cache: pip | ||
cache-dependency-path: pyproject.toml | ||
python-version: "3.8" | ||
- name: Install dependencies | ||
run: python -m pip install -U pip build twine | ||
- name: Build packages | ||
run: python -m build | ||
- name: Verify packages | ||
run: python -m twine check dist/* | ||
- name: Upload artifacts | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: python-package-distributions | ||
path: dist/ | ||
if-no-files-found: error | ||
pypi: | ||
name: Publish to PyPI | ||
runs-on: ubuntu-latest | ||
needs: [build] | ||
if: startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/master' | ||
environment: | ||
name: release | ||
url: https://pypi.org/p/pylsp-code-actions | ||
permissions: | ||
id-token: write | ||
steps: | ||
- name: Download built wheel | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: python-package-distributions | ||
path: dist/ | ||
- name: Publish to PyPI | ||
uses: pypa/gh-action-pypi-publish@release/v1 |
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,62 @@ | ||
# SPDX-FileCopyrightText: Copyright DB InfraGO AG and contributors | ||
# SPDX-License-Identifier: CC0-1.0 | ||
|
||
name: Conventional Commits | ||
|
||
on: | ||
pull_request: | ||
branches: [master] | ||
|
||
jobs: | ||
conventional-commits: | ||
runs-on: ubuntu-latest | ||
concurrency: | ||
group: commit-check-pr-${{ github.event.pull_request.number }} | ||
cancel-in-progress: true | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
- name: Install commitlint | ||
run: npm install @commitlint/cli @commitlint/config-conventional | ||
- name: Validate commit messages | ||
id: conventional-commits | ||
env: | ||
SHA_FROM: ${{ github.event.pull_request.base.sha }} | ||
SHA_TO: ${{ github.event.pull_request.head.sha }} | ||
run: | | ||
delim="_EOF_$(uuidgen)" | ||
echo "validation-result<<$delim" >> "$GITHUB_OUTPUT" | ||
r=0 | ||
npx commitlint --from "$SHA_FROM" --to "$SHA_TO" >> "$GITHUB_OUTPUT" 2>&1 || r=$? | ||
echo "$delim" >> "$GITHUB_OUTPUT" | ||
exit $r | ||
- name: Find conventional commit comment on PR | ||
uses: peter-evans/find-comment@v3 | ||
if: always() && steps.conventional-commits.outcome == 'failure' | ||
id: fc | ||
with: | ||
issue-number: ${{ github.event.pull_request.number }} | ||
comment-author: 'github-actions[bot]' | ||
body-includes: conventional commit | ||
- name: Post comment if validation failed | ||
uses: peter-evans/create-or-update-comment@v4 | ||
if: always() && steps.conventional-commits.outcome == 'failure' | ||
with: | ||
comment-id: ${{ steps.fc.outputs.comment-id }} | ||
issue-number: ${{ github.event.pull_request.number }} | ||
body: | | ||
The pull request does not conform to the conventional commit specification. Please ensure that your commit messages follow the spec: <https://www.conventionalcommits.org/>. | ||
We also strongly recommend that you set up your development environment with pre-commit, as described in our [CONTRIBUTING guidelines](https://github.com/DSD-DBS/pylsp-code-actions/blob/master/CONTRIBUTING.md). This will run all the important checks right before you commit your changes, and avoids lengthy CI wait time and round trips. | ||
This is the commit validation log: | ||
``` | ||
${{ steps.conventional-commits.outputs.validation-result }} | ||
``` | ||
Here are some examples of valid commit messages: | ||
``` | ||
build: Bump dependency versions | ||
docs(user): Add model creation workflow | ||
feat: Add a monitoring dashboard | ||
edit-mode: replace |
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,158 @@ | ||
# Copyright DB InfraGO AG and contributors | ||
# SPDX-License-Identifier: CC0-1.0 | ||
|
||
# Byte-compiled / optimized / DLL files | ||
__pycache__/ | ||
*.py[cod] | ||
*$py.class | ||
|
||
# C extensions | ||
*.so | ||
|
||
# Distribution / packaging | ||
.Python | ||
build/ | ||
develop-eggs/ | ||
dist/ | ||
downloads/ | ||
eggs/ | ||
.eggs/ | ||
lib/ | ||
lib64/ | ||
parts/ | ||
sdist/ | ||
var/ | ||
wheels/ | ||
share/python-wheels/ | ||
*.egg-info/ | ||
.installed.cfg | ||
*.egg | ||
MANIFEST | ||
|
||
# PyInstaller | ||
# Usually these files are written by a python script from a template | ||
# before PyInstaller builds the exe, so as to inject date/other infos into it. | ||
*.manifest | ||
*.spec | ||
|
||
# Installer logs | ||
pip-log.txt | ||
pip-delete-this-directory.txt | ||
|
||
# Unit test / coverage reports | ||
htmlcov/ | ||
.tox/ | ||
.nox/ | ||
.coverage | ||
.coverage.* | ||
.cache | ||
nosetests.xml | ||
coverage.xml | ||
*.cover | ||
*.py,cover | ||
.hypothesis/ | ||
.pytest_cache/ | ||
cover/ | ||
|
||
# Translations | ||
*.mo | ||
*.pot | ||
|
||
# Django stuff: | ||
*.log | ||
local_settings.py | ||
db.sqlite3 | ||
db.sqlite3-journal | ||
|
||
# Flask stuff: | ||
instance/ | ||
.webassets-cache | ||
|
||
# Scrapy stuff: | ||
.scrapy | ||
|
||
# Sphinx documentation | ||
docs/_build/ | ||
docs/source/code/ | ||
docs/source/_build | ||
|
||
# PyBuilder | ||
.pybuilder/ | ||
target/ | ||
|
||
# Jupyter Notebook | ||
.ipynb_checkpoints | ||
|
||
# IPython | ||
profile_default/ | ||
ipython_config.py | ||
|
||
# pyenv | ||
# For a library or package, you might want to ignore these files since the code is | ||
# intended to run in multiple environments; otherwise, check them in: | ||
# .python-version | ||
|
||
# pipenv | ||
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control. | ||
# However, in case of collaboration, if having platform-specific dependencies or dependencies | ||
# having no cross-platform support, pipenv may install dependencies that don't work, or not | ||
# install all needed dependencies. | ||
#Pipfile.lock | ||
|
||
# poetry | ||
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control. | ||
# This is especially recommended for binary packages to ensure reproducibility, and is more | ||
# commonly ignored for libraries. | ||
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control | ||
#poetry.lock | ||
|
||
# pdm | ||
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control. | ||
#pdm.lock | ||
# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it | ||
# in version control. | ||
# https://pdm.fming.dev/#use-with-ide | ||
.pdm.toml | ||
|
||
# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm | ||
__pypackages__/ | ||
|
||
# Celery stuff | ||
celerybeat-schedule | ||
celerybeat.pid | ||
|
||
# SageMath parsed files | ||
*.sage.py | ||
|
||
# Environments | ||
.env | ||
.venv | ||
env/ | ||
venv/ | ||
ENV/ | ||
env.bak/ | ||
venv.bak/ | ||
|
||
# Spyder project settings | ||
.spyderproject | ||
.spyproject | ||
|
||
# Rope project settings | ||
.ropeproject | ||
|
||
# mkdocs documentation | ||
/site | ||
|
||
# mypy | ||
.mypy_cache/ | ||
.dmypy.json | ||
dmypy.json | ||
|
||
# Pyre type checker | ||
.pyre/ | ||
|
||
# pytype static type analyzer | ||
.pytype/ | ||
|
||
# Cython debug symbols | ||
cython_debug/ |
Oops, something went wrong.