This is an automated email from the ASF dual-hosted git repository.
erose pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ozone-site.git
The following commit(s) were added to refs/heads/master by this push:
new fbae71575 HDDS-14546. [Website v2] Add `lint` and `lint:fix` commands
(#318)
fbae71575 is described below
commit fbae715752b6922b585c8c696040479a43e13b9b
Author: Yurii Palamarchuk <[email protected]>
AuthorDate: Wed Mar 4 17:17:47 2026 +0100
HDDS-14546. [Website v2] Add `lint` and `lint:fix` commands (#318)
Co-authored-by: Wei-Chiu Chuang <[email protected]>
Co-authored-by: Ethan Rose <[email protected]>
---
.github/scripts/markdownlint.sh | 23 -----------------------
.github/scripts/yamllint.sh | 21 ---------------------
.github/workflows/static.yml | 17 +++--------------
.yamllint.yml | 1 +
CONTRIBUTING.md | 14 ++++++++++++++
package.json | 4 +++-
6 files changed, 21 insertions(+), 59 deletions(-)
diff --git a/.github/scripts/markdownlint.sh b/.github/scripts/markdownlint.sh
deleted file mode 100755
index 4d010fa49..000000000
--- a/.github/scripts/markdownlint.sh
+++ /dev/null
@@ -1,23 +0,0 @@
-#!/usr/bin/env sh
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-
-
-root="$(git rev-parse --show-toplevel)"
-
-pnpm markdownlint "$root"
-
diff --git a/.github/scripts/yamllint.sh b/.github/scripts/yamllint.sh
deleted file mode 100755
index c10a9c65a..000000000
--- a/.github/scripts/yamllint.sh
+++ /dev/null
@@ -1,21 +0,0 @@
-#!/usr/bin/env sh
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-
-
-root="$(git rev-parse --show-toplevel)"
-yamllint --format=colored "$root"
diff --git a/.github/workflows/static.yml b/.github/workflows/static.yml
index 7b4550aab..a23cdee0e 100644
--- a/.github/workflows/static.yml
+++ b/.github/workflows/static.yml
@@ -73,7 +73,7 @@ jobs:
if: ${{ failure() }}
run: |
cat ${{ env.resource_dir }}/spelling_tips.md >> $GITHUB_STEP_SUMMARY
- lint-markdown:
+ lint:
runs-on: ubuntu-latest
steps:
- name: Checkout project
@@ -89,10 +89,8 @@ jobs:
cache: pnpm
- name: Install pnpm dependencies
run: pnpm install --dev
- - name: Run markdownlint
- working-directory: ${{ env.script_dir }}
- run: |
- ./markdownlint.sh
+ - name: Run lint
+ run: pnpm run lint
check-sidebar:
runs-on: ubuntu-latest
steps:
@@ -117,12 +115,3 @@ jobs:
if: ${{ failure() }}
run: |
cat ${{ env.resource_dir }}/sidebar_tips.md >> $GITHUB_STEP_SUMMARY
- lint-yaml:
- runs-on: ubuntu-latest
- steps:
- - name: Checkout project
- uses: actions/checkout@v4
- - name: Run yamllint
- working-directory: ${{ env.script_dir }}
- run: |
- ./yamllint.sh
diff --git a/.yamllint.yml b/.yamllint.yml
index 45e12885a..f0d3d9b9b 100644
--- a/.yamllint.yml
+++ b/.yamllint.yml
@@ -21,6 +21,7 @@ ignore:
- pnpm-lock.yaml
- node_modules
- "**/static/docs"
+- build
rules:
anchors: enable
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index c644f8e54..828161794 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -43,6 +43,20 @@ Please follow the same [Jira
guidelines](https://github.com/apache/ozone/blob/ma
The Apache Ozone Website uses [Docusaurus](https://docusaurus.io/) as a static
site generator. Most simple updates to the website can be done with little
knowledge of Docusaurus, but for more complex modifications to the website or a
better understanding of how it is built, see the Docusaurus
[documentation](https://docusaurus.io/docs) and
[API](https://docusaurus.io/docs/cli).
+### Linting and Formatting
+
+Use these commands when working on the site:
+
+```bash
+pnpm run lint
+pnpm run lint:fix
+```
+
+- `pnpm run lint` runs checks only from markdownlint and yamllint (no files
are modified).
+- `pnpm run lint:fix` applies auto-fixes from markdownlint.
+
+**Prerequisites**: The lint scripts require `yamllint`, which is not a Node.js
package and must be installed separately. Install it via pip (`pip install
yamllint`) or your system package manager (e.g. `brew install yamllint` on
macOS).
+
### Directory Layout
- [docusaurus.config.js](https://docusaurus.io/docs/configuration)
diff --git a/package.json b/package.json
index 539ea84bb..e35282e2e 100644
--- a/package.json
+++ b/package.json
@@ -12,7 +12,9 @@
"clear": "docusaurus clear",
"serve": "docusaurus serve --port 3001",
"write-translations": "docusaurus write-translations",
- "write-heading-ids": "docusaurus write-heading-ids"
+ "write-heading-ids": "docusaurus write-heading-ids",
+ "lint": "markdownlint \"$(git rev-parse --show-toplevel)\" && yamllint
--format=colored \"$(git rev-parse --show-toplevel)\"",
+ "lint:fix": "markdownlint --fix \"$(git rev-parse --show-toplevel)\" &&
yamllint --format=colored \"$(git rev-parse --show-toplevel)\""
},
"dependencies": {
"@docusaurus/core": "3.7.0",
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]