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

Lint schemes when PRs are created and merged #15

Merged
merged 1 commit into from
Aug 21, 2024
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
4 changes: 2 additions & 2 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
blank_issues_enabled: true
contact_links:
- system: "base16"
name: Learn more about the various specs and larger ecosystem
name: Learn more about the various specs and larger ecosystem
url: https://github.com/base16-project/home
about: Sometimes the answers are right there, just waiting to be discovered.
- system: "base16"
name: Discuss within the broader project
name: Discuss within the broader project
about: Your issue is broadly applicable to most Base16 schemes (or the whole ecosystem).
url: https://github.com/base16-project/home/issues/new
20 changes: 20 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Test
on:

Check warning on line 2 in .github/workflows/test.yml

View workflow job for this annotation

GitHub Actions / run

2:1 [truthy] truthy value should be one of [false, true]
pull_request:
branches:
- "spec-**"
push:
branches:
- "spec-**"
jobs:
run:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Install deps
run: sudo apt install yamllint

- name: Lint schemes
run: yamllint ${{ github.workspace }} && ${{ github.workspace }}/scripts/lint "${{ github.workspace }}"
11 changes: 11 additions & 0 deletions .yamllint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---

extends: default

rules:
document-start: disable
comments: disable
line-length:
max: 120
level: error
allow-non-breakable-inline-mappings: true
1 change: 0 additions & 1 deletion base16/ayu-mirage.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,3 @@ palette:
base0D: "5CCFE6"
base0E: "D4BFFF"
base0F: "F29E74"

16 changes: 8 additions & 8 deletions base16/brewer.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ palette:
base06: "dadbdc" # +++
base07: "fcfdfe" # ++++

base08: "e31a1c" # red
base09: "e6550d" # orange
base0A: "dca060" # yellow
base0B: "31a354" # green
base0C: "80b1d3" # aqua
base0D: "3182bd" # blue
base0E: "756bb1" # purple
base0F: "b15928" # brown
base08: "e31a1c" # red
base09: "e6550d" # orange
base0A: "dca060" # yellow
base0B: "31a354" # green
base0C: "80b1d3" # aqua
base0D: "3182bd" # blue
base0E: "756bb1" # purple
base0F: "b15928" # brown
4 changes: 2 additions & 2 deletions base16/dracula.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ name: "Dracula"
author: "Mike Barkmin (http://github.com/mikebarkmin) based on Dracula Theme (http://github.com/dracula)"
variant: "dark"
palette:
base00: "282936" #background
base00: "282936" # background
base01: "3a3c4e"
base02: "4d4f68"
base03: "626483"
base04: "62d6e8"
base05: "e9e9f4" #foreground
base05: "e9e9f4" # foreground
base06: "f1f2f8"
base07: "f7f7fb"
base08: "ea51b2"
Expand Down
3 changes: 0 additions & 3 deletions base16/heetch.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,3 @@ palette:
base0D: "BD0152"
base0E: "82034C"
base0F: "470546"



1 change: 0 additions & 1 deletion base16/helios.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,3 @@ palette:
base0D: "1e8bac" # blue
base0E: "be4264" # purple
base0F: "c85e0d" # brown

4 changes: 3 additions & 1 deletion base16/papercolor-dark.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
system: "base16"
name: "PaperColor Dark"
author: "Jon Leopard (http://github.com/jonleopard) based on PaperColor Theme (https://github.com/NLKNguyen/papercolor-theme)"
author: |
Jon Leopard (http://github.com/jonleopard)
based on PaperColor Theme (https://github.com/NLKNguyen/papercolor-theme)
variant: "dark"
palette:
base00: "1c1c1c" # Default Background
Expand Down
4 changes: 3 additions & 1 deletion base16/papercolor-light.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
system: "base16"
name: "PaperColor Light"
author: "Jon Leopard (http://github.com/jonleopard) based on PaperColor Theme (https://github.com/NLKNguyen/papercolor-theme)"
author: |
Jon Leopard (http://github.com/jonleopard)
based on PaperColor Theme (https://github.com/NLKNguyen/papercolor-theme)
variant: "light"
palette:
base00: "eeeeee" # Default Background
Expand Down
16 changes: 8 additions & 8 deletions base16/pasque.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ palette:
base06: "EDEAEF"
base07: "BBAADD"

base08: "A92258" #Pink
base09: "918889" #Gray
base0A: "804ead" #Pasque
base0B: "C6914B" #Gold
base0C: "7263AA" #Lavender
base0D: "8E7DC6" #Blue
base0E: "953B9D" #Violet
base0F: "59325C" #Magenta
base08: "A92258" # Pink
base09: "918889" # Gray
base0A: "804ead" # Pasque
base0B: "C6914B" # Gold
base0C: "7263AA" # Lavender
base0D: "8E7DC6" # Blue
base0E: "953B9D" # Violet
base0F: "59325C" # Magenta
2 changes: 0 additions & 2 deletions base16/rebecca.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,3 @@ palette:
base0D: "2de0a7" # functions
base0E: "7aa5ff" # keywords
base0F: "ff79c6" # deprecations


2 changes: 0 additions & 2 deletions base16/saga.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,3 @@ palette:
base0D: "c9fff7" # Celeste
base0E: "dcc3f9" # Anemone
base0F: "f6dddd" # Lycoris


4 changes: 3 additions & 1 deletion base16/shades-of-purple.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
system: "base16"
name: "Shades of Purple"
author: "Iolar Demartini Junior (http://github.com/demartini) based on Shades of Purple Theme (https://github.com/ahmadawais/shades-of-purple-vscode)."
author: |
Iolar Demartini Junior (http://github.com/demartini
based on Shades of Purple Theme (https://github.com/ahmadawais/shades-of-purple-vscode).
variant: "dark"
palette:
base00: "1e1e3f" # default background
Expand Down
4 changes: 3 additions & 1 deletion base16/snazzy.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
system: "base16"
name: "Snazzy"
author: "Chawye Hsu (https://github.com/chawyehsu) based on Hyper Snazzy Theme (https://github.com/sindresorhus/hyper-snazzy)"
author: |
Chawye Hsu (https://github.com/chawyehsu)
based on Hyper Snazzy Theme (https://github.com/sindresorhus/hyper-snazzy)
variant: "dark"
palette:
base00: "282a36"
Expand Down
4 changes: 3 additions & 1 deletion base16/spaceduck.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
system: "base16"
name: "Spaceduck"
author: "Guillermo Rodriguez (https://github.com/pineapplegiant), packaged by Gabriel Fontes (https://github.com/Misterio77)"
author: |
Guillermo Rodriguez (https://github.com/pineapplegiant),
packaged by Gabriel Fontes (https://github.com/Misterio77)
variant: "dark"
palette:
base00: "16172d"
Expand Down
4 changes: 2 additions & 2 deletions base16/sparky.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ palette:
base01: "00313C" # 547 C - Lighter Background
base02: "003C46" # 547 CP - Selection
base03: "003B49" # 309 C - Comments
base04: "00778B" # 7705 C - Lightest Background
base04: "00778B" # 7705 C - Lightest Background
base05: "F4F5F0" # 11-0601 Tcx - Foreground
base06: "F5F5F1" # P 179-1 U - Grey
base07: "FFFFFF" # Hex White - White - there is no whiter Pantone than 11-0601 Tcx
Expand All @@ -18,4 +18,4 @@ palette:
base0C: "2DCCD3" # 319 C - Cyan
base0D: "4698CB" # 7688 C - Blue
base0E: "D59ED7" # 7438 C - Purple
base0F: "9B704D" # 10367 C - Brown
base0F: "9B704D" # 10367 C - Brown
6 changes: 3 additions & 3 deletions base24/sparky.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ palette:
base01: "00313C" # 547 C - Lighter Background
base02: "003C46" # 547 CP - Selection
base03: "003B49" # 309 C - Comments
base04: "00778B" # 7705 C - Lightest Background
base04: "00778B" # 7705 C - Lightest Background
base05: "F4F5F0" # 11-0601 Tcx - Foreground
base06: "F5F5F1" # P 179-1 U - Grey
base07: "FFFFFF" # Hex White - White - there is no whiter Pantone than 11-0601 Tcx
Expand All @@ -20,10 +20,10 @@ palette:
base0E: "D59ED7" # 7438 C - Purple
base0F: "9B704D" # 10367 C - Brown
base10: "4B4F54" # 7540 C - Light Black
base11: "212322" # 419 C - Black
base11: "212322" # 419 C - Black
base12: "FF7276" # 805 C - Light Red
base13: "F6EB61" # 100 C - Light Yellow - used due to colourblind a11y with Light Orange
base14: "8EDD65" # 7487 C - Light Green
base15: "00C1D5" # 3115 C - Light Cyan
base16: "69B3E7" # 292 C - Light Blue
base17: "F99FC9" # 210 C - Light Purple/Pink
base17: "F99FC9" # 210 C - Light Purple/Pink
28 changes: 28 additions & 0 deletions scripts/lint
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#!/usr/bin/env sh

workspace="$1"
supported_schemes_systems="base16 base24"

if [ -z $workspace ]; then
echo "Missing 'workspace' argument"
fi

for scheme_system in $supported_schemes_systems; do
for scheme_path in "$workspace/$scheme_system"/*; do
scheme_filename=$(basename -- "$scheme_path")

case "$scheme_filename" in
*.yaml)
if ! $(grep -q "author" "$scheme_path" \
&& grep -q "name" "$scheme_path" \
&& grep -q "palette" "$scheme_path" \
&& grep -q "system" "$scheme_path" \
&& grep -q "variant" "$scheme_path"); then

echo "Error: Missing one of the required yaml properties (author|name|palette|system|variant) in $scheme_path"
exit 1
fi
;;
esac
done
done