Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add linting for the documentation and fix any current issues #149

Merged
merged 17 commits into from
Aug 19, 2024
Merged
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
14 changes: 14 additions & 0 deletions .github/workflows/_lint-docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: Lint documentation

on:
push:
paths:
- '**.md'
pull_request:
workflow_dispatch:

jobs:
meszarosrob marked this conversation as resolved.
Show resolved Hide resolved
wp-scripts-lint:
uses: inpsyde/reusable-workflows/.github/workflows/wp-scripts-lint.yml@main
with:
LINT_TOOLS: '["md-docs"]'
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
## PhpStorm
.idea/

## npm
/node_modules/
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,3 +45,7 @@ groups here:
* [Create plugin archive](./docs/archive-creation.md)
* [Automatic release](./docs/automatic-release.md)
* [DDEV Playwright](./docs/ddev-playwright.md)

**Note:**

Workflow files prefixed with `_` are specific to the repository and cannot be reused.
2 changes: 1 addition & 1 deletion docs/archive-creation.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ To achieve that, the reusable workflow:
6. Runs `wp dist-archive` to create the final archive (with builtin support for a `.distignore` file)
7. Uploads it as an artifact for download or further processing

## Simple usage example:
## Simple usage example

```yml
name: Create release package
Expand Down
8 changes: 4 additions & 4 deletions docs/assets-compilation.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

This workflow utilizes
the [Composer Asset Compiler](https://github.com/inpsyde/composer-asset-compiler) to compile assets.
For details, refer to https://github.com/inpsyde/composer-asset-compiler#pre-compilation.
For details, refer to [Pre-compilation](https://github.com/inpsyde/composer-asset-compiler#pre-compilation).

**Simplest possible example:**

Expand All @@ -16,9 +16,9 @@ jobs:
uses: inpsyde/reusable-workflows/.github/workflows/build-assets-compilation.yml@main
```

### Configuration parameters
## Configuration parameters

#### Inputs
### Inputs

| Name | Default | Description |
|-----------------------|-------------------------------|-----------------------------------------------------------------------------------|
Expand All @@ -30,7 +30,7 @@ jobs:
| `COMPOSER_ARGS` | `'--prefer-dist'` | Set of arguments passed to Composer |
| `COMPILE_ASSETS_ARGS` | `'-v --env=root'` | Set of arguments passed to Composer Asset Compiler |

#### Secrets
### Secrets

| Name | Description |
|-----------------------|------------------------------------------------------------------------------------------|
Expand Down
10 changes: 5 additions & 5 deletions docs/build-and-push-assets.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ is moved** to point to the commit that contains the compiled assets.
to avoid running the workflow when no asset sources are changed. However, it should not be used
for built branches and release branch strategies because the sync should happen on every push.

## Simple usage example:
## Simple usage example

```yml
name: Build and push assets
Expand Down Expand Up @@ -192,8 +192,8 @@ The following table provides an overview when `COMPILE_SCRIPT_DEV` or `COMPILE_S
|--------|--------------------|-----------------------|
| `''` | push to branch | `COMPILE_SCRIPT_DEV` |
| `''` | create release/tag | `COMPILE_SCRIPT_PROD` |
| `dev` | _not evaluated_ | `COMPILE_SCRIPT_DEV` |
| `prod` | _not evaluated_ | `COMPILE_SCRIPT_PROD` |
| `dev` | *not evaluated* | `COMPILE_SCRIPT_DEV` |
| `prod` | *not evaluated* | `COMPILE_SCRIPT_PROD` |

**Example:** I want to push to a branch `production` and "production"-ready assets should be
compiled:
Expand Down Expand Up @@ -260,7 +260,7 @@ same as the two commits would have been made as a single commit including both.
> commit belongs to which "real" commit?

As a side effect of using the
recommended [concurrency settings] (https://docs.github.com/en/actions/using-jobs/using-concurrency)
recommended [concurrency settings](https://docs.github.com/en/actions/using-jobs/using-concurrency)
, the git history will be linear. The compilation commit would normally refer to the previous
commit, whatever that is. In the case of cherry-picking or another non-linear branch merging, this "
linearity" could be compromised. For this reason, the workflow adds to the commit message the commit
Expand Down Expand Up @@ -308,7 +308,7 @@ By passing a key associated with the GitHub user defined in the required `GITHUB
workflow can install these packages.

Please note that in such cases it is a good practice not to use a "personal" GitHub user, but an
_ad-hoc_ "bot" user with an _ad-hoc_ private SSH key used only for the scope.
*ad-hoc* "bot" user with an *ad-hoc* private SSH key used only for the scope.

---

Expand Down
2 changes: 1 addition & 1 deletion docs/ddev-playwright.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Use the DDEV env variables (`DDEV_ENV_VARS`) for debug flags of your project nee

Also, it is possible to change some DDEV config values, such as the PHP version (`PHP_VERSION`).

## Usage example:
## Usage example

```yml
name: Run Playwright tests via DDEV
Expand Down
2 changes: 2 additions & 0 deletions docs/php.md
tyrann0us marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
<!-- markdownlint-disable MD024 -->

# Reusable workflows – PHP

## Coding standards analysis
Expand Down
2 changes: 1 addition & 1 deletion docs/wp-scripts.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ jobs:
```

---
**Note**
**Note:**

Stylelint [requires quotes](https://developer.wordpress.org/block-editor/reference-guides/packages/packages-scripts/#lint-style)
around file glob patterns.
Expand Down
Loading