Skip to content

Commit

Permalink
MAINT: move labels configuration to labels/ folder (#196)
Browse files Browse the repository at this point in the history
  • Loading branch information
redeboer authored Oct 6, 2023
1 parent 54d8d85 commit e3696d8
Show file tree
Hide file tree
Showing 8 changed files with 17 additions and 17 deletions.
1 change: 1 addition & 0 deletions .cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
"docs/adr/*/*",
"docs/conf.py",
"labels.toml",
"labels/*.toml",
"Makefile",
"Manifest.toml",
"Project.toml",
Expand Down
20 changes: 10 additions & 10 deletions .github/workflows/sync-labels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,15 @@ jobs:
pip install labels
- name: Sync general issue labels
run: |
labels sync -o ComPWA -r ampform
labels sync -o ComPWA -r benchmarks
labels sync -o ComPWA -r compwa-org
labels sync -o ComPWA -r RUB-EP1-AG
labels sync -o ComPWA -r qrules
labels sync -o ComPWA -r repo-maintenance
labels sync -o ComPWA -r sphinxcontrib-hep-pdgref
labels sync -o ComPWA -r tensorwaves
labels sync -o ComPWA -r update-pip-constraints
labels sync --filename labels/default.toml --owner ComPWA --repo ampform
labels sync --filename labels/default.toml --owner ComPWA --repo benchmarks
labels sync --filename labels/default.toml --owner ComPWA --repo compwa-org
labels sync --filename labels/default.toml --owner ComPWA --repo RUB-EP1-AG
labels sync --filename labels/default.toml --owner ComPWA --repo qrules
labels sync --filename labels/default.toml --owner ComPWA --repo repo-maintenance
labels sync --filename labels/default.toml --owner ComPWA --repo sphinxcontrib-hep-pdgref
labels sync --filename labels/default.toml --owner ComPWA --repo tensorwaves
labels sync --filename labels/default.toml --owner ComPWA --repo update-pip-constraints
- name: Sync issue labels for physics repositories
run: |
labels sync --filename labels-physics.toml -o ComPWA -r PWA-pages
labels sync --filename labels/physics.toml --owner ComPWA --repo PWA-pages
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -126,4 +126,4 @@ repos:
- id: toml-sort
args:
- --in-place
exclude: (?x)^(labels.toml|labels-physics.toml)$
exclude: (?x)^(labels/.*\.toml)$
1 change: 1 addition & 0 deletions .taplo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ exclude = [
"**/Manifest.toml",
"**/Project.toml",
"labels*.toml",
"labels/*.toml",
]

[formatting]
Expand Down
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion src/repoma/check_dev_files/github_labels.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""Check whether the repository (still) contains a ``labels.toml`` file.
"""Check whether the repository (still) contains a :file:`labels.toml` file.
If it's still there remove it, because it is now managed through
https://github.com/ComPWA/repo-maintenance.
Expand Down
8 changes: 3 additions & 5 deletions src/repoma/check_dev_files/toml.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""Configuration for working with TOML files."""

import os
import shutil
from glob import glob
from pathlib import Path
from typing import List, Union

Expand Down Expand Up @@ -73,10 +73,8 @@ def _update_tomlsort_hook() -> None:
repo="https://github.com/pappasam/toml-sort",
hooks=[CommentedMap(id="toml-sort", args=["--in-place"])],
)
excludes = ["labels.toml", "labels-physics.toml"]
excludes = [f for f in excludes if os.path.exists(f)]
if excludes:
expected_hook["hooks"][0]["exclude"] = "(?x)^(" + "|".join(excludes) + ")$"
if glob("labels/*.toml"):
expected_hook["hooks"][0]["exclude"] = r"(?x)^(labels/.*\.toml)$"
update_single_hook_precommit_repo(expected_hook)


Expand Down

0 comments on commit e3696d8

Please sign in to comment.