From 035c5e3d82f33b5c466985a2224524409ca77456 Mon Sep 17 00:00:00 2001 From: Max Clayton Clowes Date: Mon, 15 Dec 2025 15:03:31 +0000 Subject: [PATCH] Adding vale --- .github/workflows/check-vale.yml | 35 +++++++ .gitignore | 3 + .vale.ini | 48 +++++++++ .../config/vocabularies/Codat/accept.txt | 98 +++++++++++++++++++ .../config/vocabularies/Codat/reject.txt | 7 ++ package.json | 5 +- 6 files changed, 195 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/check-vale.yml create mode 100644 .vale.ini create mode 100644 .vale/styles/config/vocabularies/Codat/accept.txt create mode 100644 .vale/styles/config/vocabularies/Codat/reject.txt diff --git a/.github/workflows/check-vale.yml b/.github/workflows/check-vale.yml new file mode 100644 index 000000000..2112519bf --- /dev/null +++ b/.github/workflows/check-vale.yml @@ -0,0 +1,35 @@ +name: Check - Vale + +on: + push: + branches: + - main + paths: + - 'docs/**' + - 'blog/**' + - '.vale.ini' + - '.vale/**' + pull_request: + paths: + - 'docs/**' + - 'blog/**' + - '.vale.ini' + - '.vale/**' + +jobs: + vale: + name: Vale linting + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Vale Linter + uses: errata-ai/vale-action@reviewdog + with: + files: docs + reporter: github-pr-review + fail_on_error: false + vale_flags: "--config=.vale.ini" + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.gitignore b/.gitignore index 26775670f..3a7476140 100644 --- a/.gitignore +++ b/.gitignore @@ -43,3 +43,6 @@ static/**/node_modules/ # JetBrains Rider .idea/ *.sln.iml + +# Vale - downloaded style packages (run `vale sync` to restore) +.vale/styles/Google/ diff --git a/.vale.ini b/.vale.ini new file mode 100644 index 000000000..ceae9724a --- /dev/null +++ b/.vale.ini @@ -0,0 +1,48 @@ +StylesPath = .vale/styles +MinAlertLevel = suggestion + +Vocab = Codat + +Packages = Google + +# Global ignores - skip frontmatter +[formats] +mdx = md + +# File patterns +[*.{md,mdx}] +BasedOnStyles = Vale, Google + +# Disable rules that conflict with technical docs or MDX +# Acronyms - too noisy for API docs +Google.Acronyms = NO +# Allow "we" in company documentation +Google.We = NO +# Spacing rule has false positives with MDX components +Google.Spacing = NO +# Semicolons in code references cause false positives +Google.Semicolons = suggestion + +# Demote some rules to suggestions rather than warnings +Google.Headings = suggestion +Google.Parens = suggestion +Google.Passive = suggestion +Google.Will = suggestion +Google.FirstPerson = suggestion +Google.Exclamation = suggestion +Google.Colons = suggestion +Google.Quotes = suggestion + +# Vale built-in rules +Vale.Spelling = NO +Vale.Terms = YES + +# Ignore code blocks, frontmatter, and JSX +BlockIgnores = (?s) *```.*?```, (?s)^---.*?--- +TokenIgnores = (`[^`]+`), (\{[^}]+\}), (<[A-Z][^>]*>.*?]*>), (<[A-Z][^/>]*/?>) + +[*.yml] +BasedOnStyles = + +[*.json] +BasedOnStyles = diff --git a/.vale/styles/config/vocabularies/Codat/accept.txt b/.vale/styles/config/vocabularies/Codat/accept.txt new file mode 100644 index 000000000..fca2be8ee --- /dev/null +++ b/.vale/styles/config/vocabularies/Codat/accept.txt @@ -0,0 +1,98 @@ +API +APIs +BACS +BigCommerce +Capchase +Chargebee +Codat +Codat's +datasource +datasources +datatype +datatypes +deauthorization +deauthorized +decisioning +drawdowns +eCommerce +endpoint +endpoints +FreshBooks +IBAN +Intacct +Intacct's +Intuit +Intuit's +Lightspeed +Maxio +metadata +MYOB +neobanks +NetSuite +Pandle +payables +Phorest +PrestaShop +QuickBooks +recategorization +recategorize +recategorizing +Recurly +SDK +SDKs +Svix +TrueLayer +TrueLayer's +usecase +usecases +Wayflyer +webhook +webhooks +writeback +Xero +Xero's +Zettle +frontmatter +codeblock +codeblocks +async +OAuth +iframe +dropdown +multi-select +multi-currency +onboarding +config +repo +repos +changelog +Presta +financials +serverless +subdomain +subdomains +idempotency +boolean +booleans +nullable +enum +enums +timestamp +timestamps +hostname +param +params +JSON +UUID +UUIDs +SMB +SMBs +lender +lenders +fintech +fintechs +Plaid +Stripe +Chargebee +SaaS +GraphQL diff --git a/.vale/styles/config/vocabularies/Codat/reject.txt b/.vale/styles/config/vocabularies/Codat/reject.txt new file mode 100644 index 000000000..9e624d956 --- /dev/null +++ b/.vale/styles/config/vocabularies/Codat/reject.txt @@ -0,0 +1,7 @@ +# Words to reject/flag +# Add terms that should never appear in docs +blacklist +whitelist +master +slave +sanity check diff --git a/package.json b/package.json index 521cd49c1..59d7ad68b 100644 --- a/package.json +++ b/package.json @@ -18,7 +18,10 @@ "format:js": "prettier --write \"**/*.{js,jsx,ts,tsx}\"", "format:js:check": "prettier --check \"**/*.{js,jsx,ts,tsx}\"", "format:mdx": "prettier --write \"**/*.{md,mdx}\"", - "format:mdx:check": "prettier --check \"**/*.{md,mdx}\"" + "format:mdx:check": "prettier --check \"**/*.{md,mdx}\"", + "vale:sync": "vale sync", + "vale": "vale docs/", + "vale:check": "vale --minAlertLevel=warning docs/" }, "dependencies": { "@amplitude/analytics-browser": "^2.23.3",