From 18422ecc47ebbc35a05be08b59ddea7919c132e6 Mon Sep 17 00:00:00 2001 From: Michael Altamirano Date: Tue, 13 Feb 2024 04:02:20 +0000 Subject: [PATCH 1/9] feat: add cspell common dictionary and example snippet --- .pre-commit-config.yaml | 4 +++ cspell.jsonc | 29 +++++++++++++++++++ hooks/cspell/README.md | 22 +++++++++++++++ hooks/cspell/turo-dictionary.txt | 48 ++++++++++++++++++++++++++++++++ 4 files changed, 103 insertions(+) create mode 100644 cspell.jsonc create mode 100644 hooks/cspell/README.md create mode 100644 hooks/cspell/turo-dictionary.txt diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 0e7eb30..2b33bb6 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -24,3 +24,7 @@ repos: entry: ./hooks/yaml/yaml-extension.sh language: script files: \.yml$ + - repo: https://github.com/streetsidesoftware/cspell-cli + rev: v8.3.0 + hooks: + - id: cspell diff --git a/cspell.jsonc b/cspell.jsonc new file mode 100644 index 0000000..1182e8c --- /dev/null +++ b/cspell.jsonc @@ -0,0 +1,29 @@ +{ + "$schema": "https://raw.githubusercontent.com/streetsidesoftware/cspell/main/cspell.schema.json", + "version": "0.2", + "allowCompoundWords": false, + "caseSensitive": true, + "dictionaries": [ + "bash", + "turo-dictionary", + "css", + "en-gb", + "fonts", + "html", + "powershell", + "node", + "npm", + "typescript" + ], + "dictionaryDefinitions": [ + { + "addWords": true, + "name": "turo-dictionary", + "path": "./hooks/cspell/turo-dictionary.txt" + } + ], + "ignoreRegExpList": ["^.*TODO.*"], + "ignorePaths": [ + "./hooks/cspell/turo-dictionary.txt", + ], +} diff --git a/hooks/cspell/README.md b/hooks/cspell/README.md new file mode 100644 index 0000000..8a2a98d --- /dev/null +++ b/hooks/cspell/README.md @@ -0,0 +1,22 @@ +# Cspell Dictionary + +This `hooks/cspell` directory is not an actual `pre-commit` hook to be referenced by `id`, but a common dictionary that can be extended in repos that use `pre-commit` to avoid duplicating frequent (and Turo-specific) terminology. + +```json +// cspell.jsonc +{ + "dictionaries": [ + "turo-dictionary" + ], + "dictionaryDefinitions": [ + { + "name": "turo-dictionary", + // TODO (@michaeljaltamirano): Update path + "path": "https://raw.githubusercontent.com/turo/pre-commit-hooks/spike/testing-cspell-integration-michael/hooks/cspell/turo-dictionary.txt", + "addWords": true + } + ], +} +``` + +It's a requirement for the dictionary to be referenced at the project-level `cspell.json` file, so we cannot bake a Turo-specific configuration within this repo as a `pre-commit` hook. The next best option is making the dictionary available via HTTP GET to be pulled into repo-specific configurations. This repo has a file in `~/cspell.jsonc` that can be used as a reference. diff --git a/hooks/cspell/turo-dictionary.txt b/hooks/cspell/turo-dictionary.txt new file mode 100644 index 0000000..9aa6e8f --- /dev/null +++ b/hooks/cspell/turo-dictionary.txt @@ -0,0 +1,48 @@ +# This is a comment +# "Forbidden" syntax: !forbiddenword +autofix +benn +bugsnag +Bugsnag +carculator +checkin +cohorting +cohosts +commitlint +dtos +expedia +ezpass +figma +flagr +gdpr +grecaptcha +Iata +iata +itunes +jfrog +kustomer +latlng +lngs +lurleen +miata +michaeljaltamirano +mitek +mvsc +mweb +nissay +pois +prereqs +pricings +qrcode +schu +schumi +signup +storyblok +teamcity +toolo +# Note: "traveller" is a misspelling of "traveler" +traveller +turo +twilio +uber +vals From aa613b6b60624cfb59ef6cf0507e528042b0995f Mon Sep 17 00:00:00 2001 From: Michael Altamirano Date: Tue, 13 Feb 2024 04:27:56 +0000 Subject: [PATCH 2/9] feat: expand dictionary --- hooks/cspell/README.md | 2 +- hooks/cspell/turo-dictionary.txt | 58 ++++++++++++++++++++++++++++++-- 2 files changed, 56 insertions(+), 4 deletions(-) diff --git a/hooks/cspell/README.md b/hooks/cspell/README.md index 8a2a98d..db8bf40 100644 --- a/hooks/cspell/README.md +++ b/hooks/cspell/README.md @@ -12,7 +12,7 @@ This `hooks/cspell` directory is not an actual `pre-commit` hook to be reference { "name": "turo-dictionary", // TODO (@michaeljaltamirano): Update path - "path": "https://raw.githubusercontent.com/turo/pre-commit-hooks/spike/testing-cspell-integration-michael/hooks/cspell/turo-dictionary.txt", + "path": "https://raw.githubusercontent.com/turo/pre-commit-hooks/spike/cspell-michael/hooks/cspell/turo-dictionary.txt", "addWords": true } ], diff --git a/hooks/cspell/turo-dictionary.txt b/hooks/cspell/turo-dictionary.txt index 9aa6e8f..e757f9a 100644 --- a/hooks/cspell/turo-dictionary.txt +++ b/hooks/cspell/turo-dictionary.txt @@ -1,48 +1,100 @@ # This is a comment # "Forbidden" syntax: !forbiddenword +appsflyer autofix benn +blocklisted bugsnag Bugsnag +camelcase carculator -checkin +carfax +cargovan +carplay +checkinPrechecked cohorting +cohosting cohosts commitlint +datalayer +datepicker +datetimes +deeplink +deeplinking +devicer +dropoff dtos expedia ezpass figma flagr gdpr +giftcard +giftcards grecaptcha Iata iata +intercardinal itunes jfrog kustomer latlng +librca lngs lurleen +mastercard +meineke miata -michaeljaltamirano +millis mitek +multisave mvsc mweb nissay +northpass +onelink +ouicar +owntheadventure +pageload +pasteable +paypal +premade +prereq +prechecked pois prereqs +pricepins pricings qrcode +relayrides schu schumi signup +smartcar +snakecase +socure storyblok +sublocality +subreasons +subroute +subroutes teamcity -toolo +timeframe # Note: "traveller" is a misspelling of "traveler" traveller turo twilio +twofactor uber +unavailabilities +unionpay +upsell +youtube vals +EIGHTYFIVEPLAN +EIGHTYPLAN +NINETYPLAN +SEVENTYFIVEPLAN +SEVENTYPLAN +SIXTYPLAN +SIXTYFIVEPLAN From 1fca4252726273345f7120596c2a92a7a1c04fc7 Mon Sep 17 00:00:00 2001 From: Michael Altamirano Date: Tue, 13 Feb 2024 05:50:34 +0000 Subject: [PATCH 3/9] feat: expand dictionary pt. 2 --- hooks/cspell/turo-dictionary.txt | 39 ++++++++++++++++++++++---------- 1 file changed, 27 insertions(+), 12 deletions(-) diff --git a/hooks/cspell/turo-dictionary.txt b/hooks/cspell/turo-dictionary.txt index e757f9a..0630fa1 100644 --- a/hooks/cspell/turo-dictionary.txt +++ b/hooks/cspell/turo-dictionary.txt @@ -1,9 +1,13 @@ # This is a comment # "Forbidden" syntax: !forbiddenword +allstar appsflyer +autofilled autofix +backroads benn blocklisted +bottomsheet bugsnag Bugsnag camelcase @@ -12,18 +16,23 @@ carfax cargovan carplay checkinPrechecked +codegen cohorting cohosting cohosts commitlint +cooldown datalayer datepicker +datestring datetimes deeplink deeplinking devicer dropoff dtos +EIGHTYFIVEPLAN +EIGHTYPLAN expedia ezpass figma @@ -32,8 +41,8 @@ gdpr giftcard giftcards grecaptcha -Iata iata +Iata intercardinal itunes jfrog @@ -50,6 +59,7 @@ mitek multisave mvsc mweb +NINETYPLAN nissay northpass onelink @@ -58,18 +68,29 @@ owntheadventure pageload pasteable paypal +pois +prechecked premade prereq -prechecked -pois prereqs +preseeding pricepins pricings +prohost +promocode +publically qrcode +recaptcha +refetches relayrides +schemaorg schu schumi +SEVENTYFIVEPLAN +SEVENTYPLAN signup +SIXTYFIVEPLAN +SIXTYPLAN smartcar snakecase socure @@ -78,9 +99,10 @@ sublocality subreasons subroute subroutes +swipeable teamcity timeframe -# Note: "traveller" is a misspelling of "traveler" +totalloss traveller turo twilio @@ -89,12 +111,5 @@ uber unavailabilities unionpay upsell -youtube vals -EIGHTYFIVEPLAN -EIGHTYPLAN -NINETYPLAN -SEVENTYFIVEPLAN -SEVENTYPLAN -SIXTYPLAN -SIXTYFIVEPLAN +youtube From f6dca7e8ca2f877aab66b31435206fc0e20561b2 Mon Sep 17 00:00:00 2001 From: Michael Altamirano Date: Tue, 13 Feb 2024 06:27:43 +0000 Subject: [PATCH 4/9] feat: add remaining global keywords for final steps of testing --- hooks/cspell/turo-dictionary.txt | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/hooks/cspell/turo-dictionary.txt b/hooks/cspell/turo-dictionary.txt index 0630fa1..8906aa3 100644 --- a/hooks/cspell/turo-dictionary.txt +++ b/hooks/cspell/turo-dictionary.txt @@ -15,12 +15,16 @@ carculator carfax cargovan carplay -checkinPrechecked +centerpoint +checkin +checkins +classname codegen cohorting cohosting cohosts commitlint +concat cooldown datalayer datepicker @@ -55,6 +59,7 @@ mastercard meineke miata millis +MISNAP mitek multisave mvsc @@ -69,11 +74,15 @@ pageload pasteable paypal pois +postmessage +preapproval +prechecked prechecked premade prereq prereqs preseeding +pricepin pricepins pricings prohost @@ -86,6 +95,7 @@ relayrides schemaorg schu schumi +screenshotted SEVENTYFIVEPLAN SEVENTYPLAN signup @@ -96,11 +106,14 @@ snakecase socure storyblok sublocality +subreason subreasons subroute subroutes +subview swipeable teamcity +testcafe timeframe totalloss traveller @@ -109,7 +122,9 @@ twilio twofactor uber unavailabilities +underinsured unionpay upsell vals +webcal youtube From 913352cc7a0054a9188adef2c9753dfd1db3dbf7 Mon Sep 17 00:00:00 2001 From: Michael Altamirano Date: Tue, 13 Feb 2024 06:37:50 +0000 Subject: [PATCH 5/9] feat: add plural of concats to dictionary --- hooks/cspell/turo-dictionary.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/hooks/cspell/turo-dictionary.txt b/hooks/cspell/turo-dictionary.txt index 8906aa3..de8bf81 100644 --- a/hooks/cspell/turo-dictionary.txt +++ b/hooks/cspell/turo-dictionary.txt @@ -25,6 +25,7 @@ cohosting cohosts commitlint concat +concats cooldown datalayer datepicker From 44d1d9980779cff37f72ec601e34b59136b5023b Mon Sep 17 00:00:00 2001 From: Michael Altamirano Date: Tue, 13 Feb 2024 06:54:41 +0000 Subject: [PATCH 6/9] feat: add toggleable to dictionary --- hooks/cspell/turo-dictionary.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/hooks/cspell/turo-dictionary.txt b/hooks/cspell/turo-dictionary.txt index de8bf81..e162fc2 100644 --- a/hooks/cspell/turo-dictionary.txt +++ b/hooks/cspell/turo-dictionary.txt @@ -116,6 +116,7 @@ swipeable teamcity testcafe timeframe +toggleable totalloss traveller turo From 8fd7dbee1d52b594daf8ab7c9870e67c3f8cee34 Mon Sep 17 00:00:00 2001 From: Michael Altamirano Date: Tue, 13 Feb 2024 19:15:31 +0000 Subject: [PATCH 7/9] refactor: expand cspell.json ignorePaths for pre-commit repo --- cspell.jsonc | 14 ++++++++++++-- hooks/cspell/turo-dictionary.txt | 1 + 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/cspell.jsonc b/cspell.jsonc index 1182e8c..95c8021 100644 --- a/cspell.jsonc +++ b/cspell.jsonc @@ -9,10 +9,12 @@ "css", "en-gb", "fonts", + "go", "html", "powershell", "node", "npm", + "python", "typescript" ], "dictionaryDefinitions": [ @@ -24,6 +26,14 @@ ], "ignoreRegExpList": ["^.*TODO.*"], "ignorePaths": [ - "./hooks/cspell/turo-dictionary.txt", - ], + "./.gitignore", + "./.pre-commit-hooks.yaml", + "./containers/**", + "./docs/**", + "./hooks/**", + "./licenses/**", + "./README.md", + "./script/**", + "./versions.env" +] } diff --git a/hooks/cspell/turo-dictionary.txt b/hooks/cspell/turo-dictionary.txt index e162fc2..9210541 100644 --- a/hooks/cspell/turo-dictionary.txt +++ b/hooks/cspell/turo-dictionary.txt @@ -129,4 +129,5 @@ unionpay upsell vals webcal +yalc youtube From 96c443895be73e3b0f8c857b6199195dd440bdc8 Mon Sep 17 00:00:00 2001 From: Michael Altamirano Date: Tue, 13 Feb 2024 19:24:43 +0000 Subject: [PATCH 8/9] refactor: alphabetize dictionaries and update README example --- cspell.jsonc | 6 +++--- hooks/cspell/README.md | 22 ++++++++++++++++++++-- 2 files changed, 23 insertions(+), 5 deletions(-) diff --git a/cspell.jsonc b/cspell.jsonc index 95c8021..34f5ef0 100644 --- a/cspell.jsonc +++ b/cspell.jsonc @@ -5,16 +5,16 @@ "caseSensitive": true, "dictionaries": [ "bash", - "turo-dictionary", "css", "en-gb", "fonts", "go", "html", - "powershell", "node", "npm", + "powershell", "python", + "turo-dictionary", "typescript" ], "dictionaryDefinitions": [ @@ -35,5 +35,5 @@ "./README.md", "./script/**", "./versions.env" -] + ] } diff --git a/hooks/cspell/README.md b/hooks/cspell/README.md index db8bf40..00e3039 100644 --- a/hooks/cspell/README.md +++ b/hooks/cspell/README.md @@ -5,17 +5,35 @@ This `hooks/cspell` directory is not an actual `pre-commit` hook to be reference ```json // cspell.jsonc { + "$schema": "https://raw.githubusercontent.com/streetsidesoftware/cspell/main/cspell.schema.json", + "version": "0.2", + "allowCompoundWords": false, + "caseSensitive": true, + // https://cspell.org/docs/dictionaries/ "dictionaries": [ - "turo-dictionary" + "bash", + "css", + "en-gb", + "fonts", + "go", + "html", + "node", + "npm", + "powershell", + "python", + "turo-dictionary", + "typescript" ], "dictionaryDefinitions": [ { + "addWords": true, "name": "turo-dictionary", // TODO (@michaeljaltamirano): Update path "path": "https://raw.githubusercontent.com/turo/pre-commit-hooks/spike/cspell-michael/hooks/cspell/turo-dictionary.txt", - "addWords": true } ], + "ignoreRegExpList": ["^.*TODO.*"], + "ignorePaths": ["./.gitignore"] } ``` From f55d61aac691321d44f40327f5864ce0ff8772e1 Mon Sep 17 00:00:00 2001 From: Michael Altamirano Date: Tue, 13 Feb 2024 19:38:51 +0000 Subject: [PATCH 9/9] fix: update release notes action to try and resolve CI error --- .github/workflows/ci.yaml | 20 ++++++-------------- 1 file changed, 6 insertions(+), 14 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index c864b97..d772e6f 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -4,26 +4,18 @@ on: push: jobs: - - release-notes: - name: Release notes preview - runs-on: ubuntu-latest - if: github.ref != 'refs/heads/main' - steps: - - uses: open-turo/actions-release/release-notes-preview@v2 - with: - github-token: ${{ secrets.GITHUB_TOKEN }} - env: - NPM_TOKEN: ${{ secrets.OPEN_TURO_NPM_TOKEN }} - lint: name: Lint runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: fetch-depth: 0 - - uses: open-turo/action-pre-commit@v1 + - name: Pre-commit + uses: open-turo/action-pre-commit@v1 + - name: Check release notes on pull_request + if: github.event_name == 'pull_request' + uses: open-turo/actions-release/lint-release-notes@v4 test: name: Test