-
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Choose label button has dark background and dark text (#52)
* ci: Integrate theme verification job * fix: Remove background-color token assignment * chore: Add vscode to gitignore * ci: Add yamllint and yamlfmt as pre-commit hook * refactor: Move about yaml to theme assembler * Regenerate theme files * Set explicit linter and formatter dirs * Rework theme assembler - Improve artifact formatting and readability * Format workflow yaml files * Format source files * Format theme files * Install PyYAML for verification job * Add Actions shields to readme * Improve HACS and manual readme
- Loading branch information
1 parent
9e97760
commit 1f4bceb
Showing
17 changed files
with
308 additions
and
346 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 |
---|---|---|
@@ -1,11 +1,9 @@ | ||
name: HACS Action | ||
|
||
on: | ||
push: | ||
pull_request: | ||
schedule: | ||
- cron: "0 0 * * *" | ||
|
||
jobs: | ||
hacs: | ||
name: HACS Action | ||
|
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
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,56 @@ | ||
name: Theme Verification | ||
on: | ||
pull_request: | ||
push: | ||
jobs: | ||
verify-theme: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Set up Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: '3.x' | ||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install PyYAML | ||
- name: Create temporary directory for generated theme | ||
run: mkdir -p temp_themes | ||
- name: Backup existing themes | ||
run: | | ||
if [ -d "themes" ]; then | ||
cp -r themes themes_original | ||
fi | ||
- name: Clean and generate new themes | ||
run: | | ||
make clean | ||
make theme | ||
- name: Compare themes | ||
run: | | ||
if [ ! -d "themes_original" ]; then | ||
echo "Error: No original themes directory found to compare against" | ||
exit 1 | ||
fi | ||
# Create temporary copies without generator timestamps | ||
rm -rf temp_clean_original temp_clean_generated | ||
mkdir -p temp_clean_original temp_clean_generated | ||
cp -r themes_original/* temp_clean_original/ | ||
cp -r themes/* temp_clean_generated/ | ||
# Remove generator timestamps from all files | ||
find temp_clean_original temp_clean_generated -type f -exec sed -i '/This file was generated at/d' {} + | ||
# Using diff to compare directories | ||
if diff -r temp_clean_original temp_clean_generated; then | ||
echo "✅ Generated themes match the committed version (ignoring timestamps)" | ||
else | ||
echo "❌ Generated themes differ from the committed version" | ||
echo "Please run 'make theme' locally and commit the changes" | ||
exit 1 | ||
fi | ||
- name: Cleanup temporary directories | ||
if: always() | ||
run: |- | ||
rm -rf temp_clean_original temp_clean_generated temp_themes themes_original |
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 |
---|---|---|
@@ -1 +1,2 @@ | ||
.DS_Store | ||
/.vscode |
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,14 @@ | ||
repos: | ||
- repo: https://github.com/adrienverge/yamllint.git | ||
rev: v1.35.1 | ||
hooks: | ||
- id: yamllint | ||
files: ^(src|.github)/.*\.ya?ml$ | ||
args: | ||
- -d | ||
- relaxed | ||
- repo: https://github.com/google/yamlfmt | ||
rev: v0.14.0 | ||
hooks: | ||
- id: yamlfmt | ||
files: ^(src|.github)/.*\.ya?ml$ |
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,30 @@ | ||
.PHONY: all rebuild theme clean format | ||
|
||
all: format theme | ||
|
||
theme: clean | ||
python3 tools/theme_assembler.py | ||
|
||
clean: | ||
@echo "Cleaning theme directory..." | ||
rm -rf theme/* | ||
@echo "Theme directory cleaned." | ||
|
||
dev: | ||
chmod +x tools/rebuild_dev.sh | ||
./tools/rebuild_dev.sh | ||
|
||
format: | ||
@echo "Formatting YAML files..." | ||
pre-commit install | ||
pre-commit run --all-files | ||
@echo "YAML formatting complete." | ||
|
||
help: | ||
@echo "Available targets:" | ||
@echo " all - Run theme assembly (default)" | ||
@echo " theme - Run the theme assembler" | ||
@echo " clean - Remove generated files" | ||
@echo " dev - Run rebuild dev script" | ||
@echo " format - Format YAML files in src and theme directories" | ||
@echo " help - Show this help message" |
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
This file was deleted.
Oops, something went wrong.
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
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
Oops, something went wrong.