Skip to content

Commit

Permalink
feat: Make tree view draggable
Browse files Browse the repository at this point in the history
  • Loading branch information
huyenngn committed Jan 10, 2024
1 parent 247d0f9 commit 3a2f58a
Show file tree
Hide file tree
Showing 60 changed files with 18,339 additions and 122 deletions.
24 changes: 24 additions & 0 deletions .commitlintrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# SPDX-FileCopyrightText: Copyright DB InfraGO AG and the capellambse 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,
]]
2 changes: 1 addition & 1 deletion .git_archival.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright DB Netz AG and contributors
Copyright DB InfraGO AG and contributors
SPDX-License-Identifier: CC0-1.0

node: $Format:%H$
Expand Down
2 changes: 1 addition & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright DB Netz AG and contributors
# Copyright DB InfraGO AG and contributors
# SPDX-License-Identifier: CC0-1.0

* text=auto
Expand Down
9 changes: 5 additions & 4 deletions .github/workflows/build-test-publish.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright DB Netz AG and contributors
# Copyright DB InfraGO AG and contributors
# SPDX-License-Identifier: CC0-1.0

name: Build
Expand All @@ -18,11 +18,12 @@ jobs:
matrix:
os: [ubuntu-latest]
python_version:
- "3.9"
- "3.10"
- "3.11"
- "3.12"
include:
- os: windows-latest
python_version: "3.9"
python_version: "3.10"
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{matrix.python_version}}
Expand Down Expand Up @@ -55,7 +56,7 @@ jobs:
- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: "3.9"
python-version: "3.10"
- name: Install dependencies
run: |-
python -m pip install -U pip
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright DB Netz AG and contributors
# Copyright DB InfraGO AG and contributors
# SPDX-License-Identifier: CC0-1.0

name: Docs
Expand All @@ -18,7 +18,7 @@ jobs:
fetch-depth: 0
- uses: actions/setup-python@v2
with:
python-version: "3.9"
python-version: "3.10"
- name: Upgrade pip
run: |
python -m pip install -U pip
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright DB Netz AG and contributors
# Copyright DB InfraGO AG and contributors
# SPDX-License-Identifier: CC0-1.0

name: Lint
Expand All @@ -14,7 +14,7 @@ jobs:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: "3.9"
python-version: "3.10"
- name: Upgrade pip
run: |-
python -m pip install -U pip
Expand All @@ -30,7 +30,7 @@ jobs:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: "3.9"
python-version: "3.10"
- name: Upgrade pip
run: |-
python -m pip install -U pip
Expand Down
81 changes: 81 additions & 0 deletions .github/workflows/pr-target.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
# SPDX-FileCopyrightText: Copyright DB InfraGO AG and the capellambse contributors
# SPDX-License-Identifier: CC0-1.0

name: Conventional Commits

on:
pull_request_target:
types: [opened, synchronize]

permissions:
contents: read
pull-requests: write

jobs:
conventional-commits:
runs-on: ubuntu-latest
steps:
- name: Checkout the base branch
# Commitlint will use the configuration that is checked out; i.e. in
# this case it will use the config from the PR's base branch, which
# must have already been approved by someone with repo write access.
#
# Because commitlint accepts arbitrary JavaScript as configuration,
# this is necessary to prevent code injection attacks. Combined with
# the `pull-requests: write` permission needed for posting comments,
# this could potentially allow an attacker to merge any code into any
# branch.
#
# However, it also means that (good) pull requests intended to change
# or extend the config will be validated against the old config, which
# may cause false errors.
uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.base.ref }}

- name: Pull the PR
run: git fetch origin +${{ github.event.pull_request.head.sha }}

- name: Install commitlint
run: npm install -g @commitlint/cli

- name: Validate commit messages
id: conventional-commits
continue-on-error: true
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
commitlint --from "$SHA_FROM" --to "$SHA_TO" >> "$GITHUB_OUTPUT" 2>&1 || r=$?
echo "$delim" >> "$GITHUB_OUTPUT"
exit $r
- name: Post comment if validation failed
if: steps.conventional-commits.outcome == "failure"
env:
GH_TOKEN: ${{ github.token }}
PR_NUMBER: ${{ github.event.pull_request.number }}
TEXT: |-
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/py-capellambse/blob/master/CONTRIBUTING.rst). This will run all the important checks right before you commit your changes, and avoids lengthy CI wait time and round trips.
The following commits failed to validate:
```
${{ steps.conventional-commits.outputs.validation-result }}
```
Here are some examples of valid commit messages:
```
feat(model): Add realized_states to State and Mode
fix(aird): Fix ZeroDivisionError with zero-sized circles
docs(readme): Update project description
```
run: 'gh pr comment "$PR_NUMBER" -F - <<< "$TEXT"'
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright DB Netz AG and contributors
# Copyright DB InfraGO AG and contributors
# SPDX-License-Identifier: CC0-1.0

# Byte-compiled / optimized / DLL files
Expand Down
14 changes: 7 additions & 7 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# Copyright DB Netz AG and contributors
# Copyright DB InfraGO AG and contributors
# SPDX-License-Identifier: CC0-1.0

default_install_hook_types: [commit-msg, pre-commit]
default_stages: [commit, merge-commit]
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
rev: v4.5.0
hooks:
- id: check-added-large-files
- id: check-ast
Expand All @@ -26,11 +26,11 @@ repos:
- id: fix-byte-order-marker
- id: trailing-whitespace
- repo: https://github.com/psf/black-pre-commit-mirror
rev: 23.9.1
rev: 23.12.1
hooks:
- id: black
- repo: https://github.com/PyCQA/isort
rev: 5.12.0
rev: 5.13.2
hooks:
- id: isort
- repo: https://github.com/PyCQA/docformatter
Expand All @@ -47,11 +47,11 @@ repos:
additional_dependencies:
- pydocstyle[toml]
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.5.1
rev: v1.8.0
hooks:
- id: mypy
- repo: https://github.com/Lucas-C/pre-commit-hooks
rev: v1.4.2
rev: v1.5.4
hooks:
- id: insert-license
name: Insert license headers (shell-style comments)
Expand Down Expand Up @@ -98,6 +98,6 @@ repos:
hooks:
- id: reuse
- repo: https://github.com/qoomon/git-conventional-commits
rev: v2.6.5
rev: v2.6.7
hooks:
- id: conventional-commits
Loading

0 comments on commit 3a2f58a

Please sign in to comment.