Skip to content
Open
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/custom-words.txt
Original file line number Diff line number Diff line change
Expand Up @@ -90,4 +90,5 @@ vulnz
worktree
yaml
yml
EDITMSG
keyid
13 changes: 11 additions & 2 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ on:
- main
paths:
- ".github/workflows/docs.yml"
- "requirements-docs.txt"
- "pyproject.toml"
- "uv.lock"
- "mkdocs.yml"
- "main.py"
- "hooks.py"
Expand Down Expand Up @@ -63,7 +64,7 @@ jobs:
uses: astral-sh/setup-uv@v7

- name: Install documentation dependencies
run: uv sync
run: uv sync --all-groups

- name: Lint YAML files
run: uv run yamllint -c .github/linters/.yamllint.yml .
Expand All @@ -74,6 +75,14 @@ jobs:
with:
files: source/**

- name: Install Rust
uses: dtolnay/rust-toolchain@stable

- name: Cache Cargo
uses: Swatinem/rust-cache@v2
with:
cache-on-failure: true

- name: Install ucp-schema for runtime resolution
run: |
cargo install ucp-schema
Expand Down
16 changes: 15 additions & 1 deletion .github/workflows/linter.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,19 @@ on:
branches:
- main
- 'release/**'
paths:
- ".github/workflows/linter.yaml"
- ".github/workflows/schema-validation.yml"
- ".github/linters/**"
- ".pre-commit-config.yaml"
- "pyproject.toml"
- "package.json"
- "package-lock.json"
- "biome.json"
- "scripts/**"
- "source/**"
- "docs/**"
- "*.py"

permissions:
contents: read # Required to checkout the code
Expand Down Expand Up @@ -49,7 +62,8 @@ jobs:
LOG_LEVEL: INFO
SHELLCHECK_OPTS: -e SC1091 -e 2086
VALIDATE_ALL_CODEBASE: false
FILTER_REGEX_EXCLUDE: "^(\\.github/|\\.vscode/).*|CODE_OF_CONDUCT.md|CHANGELOG.md"
FILTER_REGEX_EXCLUDE: >-
^(\\.github/|\\.vscode/).*|CODE_OF_CONDUCT.md|CHANGELOG.md
VALIDATE_BIOME_FORMAT: false
VALIDATE_PYTHON_BLACK: false
VALIDATE_PYTHON_FLAKE8: false
Expand Down
5 changes: 3 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -55,5 +55,6 @@ repos:
hooks:
- id: prettier
name: prettier-css
types: [css] # Only run on CSS files
# If you want it to run on EVERYTHING (JS, JSON, MD), remove the 'types' line.
# Only run on CSS files
types: [css]
# To run on everything (JS, JSON, MD), remove the 'types' line.
32 changes: 21 additions & 11 deletions hooks.py
Original file line number Diff line number Diff line change
Expand Up @@ -281,20 +281,30 @@ def replace_link(match):

# Rewrite relative links to assets/ to absolute URLs
# pointing to served assets folder.
target_base = f"{base_path}assets/"
markdown = _root_pages_asset_link_rewrite(markdown, base_path)

def replace_asset_link(match):
path = match.group(1)
output = f"{target_base}{path}"
log.info(f"on_page_markdown::replace_asset_link: {path} -> {output}")
return output
return markdown

# Pattern matches: ( prefix assets/ path )
# We capture the path AFTER assets/
# Matches: (../assets/foo.img) or (assets/foo.img)
pattern = r"\"(?:(?:\.\./)+|\./)?assets/([^)\"]+)\""

markdown = re.sub(pattern, replace_asset_link, markdown)
def _root_pages_asset_link_rewrite(markdown, base_path):
"""Rewrite asset references in the root/overview to absolute links.

Uses regex to find and replace asset links with root based links.
"""
# Targeting the assets
target_base = f"{base_path}assets/"

def replace_link(match):
path = match.group(1)
# Including quotes back into the rendered new URL
output = f'"{target_base}{path}"'
return output

# Pattern matches: ( prefix assets/ path )
# We capture the path AFTER assets/
# Matches: (../assets/foo.img) or (assets/foo.img) excluding quotes
pattern = r"\"(?:(?:\.\./)+|\./)?assets/([^)\"]+)\""
markdown = re.sub(pattern, replace_link, markdown)

return markdown

Expand Down
4 changes: 4 additions & 0 deletions source/schemas/shopping/order.json
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,10 @@
},
"description": "Append-only event log of money movements (refunds, returns, credits, disputes, cancellations, etc.) that exist independently of fulfillment."
},
"currency": {
"type": "string",
"description": "ISO 4217 currency code. MUST match the currency from the originating checkout session."
},
"totals": {
"type": "array",
"items": {
Expand Down
Loading