Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MAINT: move labels configuration to labels/ folder #196

Merged
merged 1 commit into from
Oct 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@
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)$"

Check warning on line 77 in src/repoma/check_dev_files/toml.py

View check run for this annotation

Codecov / codecov/patch

src/repoma/check_dev_files/toml.py#L77

Added line #L77 was not covered by tests
update_single_hook_precommit_repo(expected_hook)


Expand Down
Loading