From 5b5c0d0f4e4b9477f5e6e12b9a8890f77c7e329a Mon Sep 17 00:00:00 2001 From: Heronimus Adie Date: Tue, 26 Mar 2024 03:56:30 +0700 Subject: [PATCH] ci: init markdown-lint and resolve linter issues (#39) Closes: WORLD-983 ## Overview Add markdown linter ## Brief Changelog - https://github.com/marketplace/actions/markdown-lint - fix markdown linter issues - customize markdown linter config: - increase `MD013/line-length` default line length from 80 (too short), to 250 (median "looks good" line length in our docs) - add `MD033/no-inline-html` necessary allowed HTML element ## Testing and Verifying - CI passed - Lint error annotation detected on changed code: ![image](https://github.com/Argus-Labs/world-engine/assets/29672212/01907dea-6de6-413e-aac8-d92e9734c00b) ![image](https://github.com/Argus-Labs/world-engine/assets/29672212/3664194a-5ee8-4e68-be79-c6784a63501f) --- .github/workflows/{lint.yml => lint-go.yml} | 0 .github/workflows/lint-md.yml | 27 +++++++++++++++++++++ .markdownlint.yaml | 21 ++++++++++++++++ README.md | 24 +++++++++--------- 4 files changed, 60 insertions(+), 12 deletions(-) rename .github/workflows/{lint.yml => lint-go.yml} (100%) create mode 100644 .github/workflows/lint-md.yml create mode 100644 .markdownlint.yaml diff --git a/.github/workflows/lint.yml b/.github/workflows/lint-go.yml similarity index 100% rename from .github/workflows/lint.yml rename to .github/workflows/lint-go.yml diff --git a/.github/workflows/lint-md.yml b/.github/workflows/lint-md.yml new file mode 100644 index 0000000..3857bc3 --- /dev/null +++ b/.github/workflows/lint-md.yml @@ -0,0 +1,27 @@ +name: Lint + +on: + pull_request: + types: [opened, synchronize, reopened] + paths: + - "**.md" + push: + branches: + - main + paths: + - "**.md" + +jobs: + lint-md: + name: Markdown + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + ## detect errors from markdownlint-cli and create annotations for them + - uses: xt0rted/markdownlint-problem-matcher@v3 + - uses: articulate/actions-markdownlint@v1 + with: + config: .markdownlint.yaml + ignore: vendor + version: 0.39.0 diff --git a/.markdownlint.yaml b/.markdownlint.yaml new file mode 100644 index 0000000..2d23120 --- /dev/null +++ b/.markdownlint.yaml @@ -0,0 +1,21 @@ +--- +# Default state for all rules +default: true + +# MD013/line-length : Line length : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md013.md +MD013: + ## Increase line length from default '80' + line_length: 250 + ## exluce code_blocks from line linter + code_blocks: false + +# MD033/no-inline-html : Inline HTML : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md033.md +MD033: + allowed_elements: + - img + - div + - br + - a + - pre + - h1 + - p diff --git a/README.md b/README.md index 1ee9ec0..f1f4ea8 100644 --- a/README.md +++ b/README.md @@ -1,33 +1,35 @@ -## Starter Game Template +# Starter Game Template This repository contains a starter World Engine project that you can use as a scaffold for your project. ## Installing World CLI -To begin your development journey with World Engine, you install -[World CLI](https://github.com/Argus-Labs/world-cli) a tool for creating, managing, and deploying World -Engine projects. +To begin your development journey with World Engine, you install +[World CLI](https://github.com/Argus-Labs/world-cli) a tool for creating, managing, and deploying World +Engine projects. Install the latest world-cli release by running: ```bash curl https://install.world.dev/cli! | bash ``` + ### Docker -Docker is used to make it easy to run the World Engine stack and its dependencies. If you don't already have Docker +Docker is used to make it easy to run the World Engine stack and its dependencies. If you don't already have Docker installed, you can find instructions for your platform here: [Installation instructions for Docker Desktop](https://docs.docker.com/compose/install/#scenario-one-install-docker-desktop) ## Getting Started -To use this template to start your own project, navigate to the directory where you want your project to live +To use this template to start your own project, navigate to the directory where you want your project to live and run: ```bash world create ``` + You will be prompted for a game name. A copy of the starter-game-template will be created in the current directory. ### Running Development Mode @@ -40,7 +42,7 @@ To use it, navigate to your project directory and run world cardinal dev ``` -### Running World Engine E2E +### Running World Engine E2E To run the World Engine stack end-to-end (i.e. in production and game engine integration), run: @@ -48,12 +50,10 @@ To run the World Engine stack end-to-end (i.e. in production and game engine int world cardinal start ``` -This command will use the `world.toml` config specified in your root project directory to run both World Engine's +This command will use the `world.toml` config specified in your root project directory to run both World Engine's Cardinal game shard and Nakama relayer (for game engine integration). -Make sure to set `CARDINAL_MODE="production"` in world.toml to run the stack in production mode and obtain the best -performance. - +Make sure to set `CARDINAL_MODE="production"` in world.toml to run the stack in production mode and obtain the best performance. ### Cardinal Editor @@ -67,4 +67,4 @@ After you create some entities in your game, it will show up on the Cardinal Edi ## Developing Your Game -For more details on how to create the game of your dream, visit the [World Engine documentation](https://world.dev) +For more details on how to create the game of your dream, visit the [World Engine documentation](https://world.dev)