diff --git a/.cspell/custom-words.txt b/.cspell/custom-words.txt index 051ff147..570b6246 100644 --- a/.cspell/custom-words.txt +++ b/.cspell/custom-words.txt @@ -90,4 +90,5 @@ vulnz worktree yaml yml +EDITMSG keyid diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index c87fea28..94335494 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -27,7 +27,8 @@ on: - main paths: - ".github/workflows/docs.yml" - - "requirements-docs.txt" + - "pyproject.toml" + - "uv.lock" - "mkdocs.yml" - "main.py" - "hooks.py" @@ -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 . @@ -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 diff --git a/.github/workflows/linter.yaml b/.github/workflows/linter.yaml index 33096bf6..ae3940b8 100644 --- a/.github/workflows/linter.yaml +++ b/.github/workflows/linter.yaml @@ -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 @@ -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 diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 1077037d..7afb8600 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -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. diff --git a/hooks.py b/hooks.py index 963476ca..bb9cfb42 100644 --- a/hooks.py +++ b/hooks.py @@ -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 diff --git a/source/schemas/shopping/order.json b/source/schemas/shopping/order.json index c170c285..80fdd4cf 100644 --- a/source/schemas/shopping/order.json +++ b/source/schemas/shopping/order.json @@ -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": {