add linting for docs markdown content

This commit is contained in:
Caesar Schinas 2023-08-16 16:34:40 +01:00
parent 8b922f661d
commit 4e059dc7f9
No known key found for this signature in database
GPG key ID: AE9108461BEA5ACF
11 changed files with 2034 additions and 7 deletions

View file

@ -10,6 +10,9 @@ indent_size = 2
indent_style = tab
insert_final_newline = true
[*.json]
indent_style = space
[*.md]
indent_style = space
trim_trailing_whitespace = false

View file

@ -10,6 +10,12 @@ jobs:
image: node:20
steps:
- uses: https://code.forgejo.org/actions/checkout@v3
- name: lint
run: |
corepack enable
pnpm install --frozen-lockfile
pnpm run lint:remark
pnpm run lint:prettier
- name: get forgejo.org and move the docs
run: |
git clone --recursive --depth 1 https://codeberg.org/forgejo/website/ /tmp/website
@ -20,12 +26,6 @@ jobs:
cd /tmp/website
corepack enable
pnpm install --frozen-lockfile
- name: lint:eslint
run: |
cd /tmp/website
corepack enable
pnpm run format-ci
pnpm run lint:eslint
- name: preview
if: ${{ secrets.WEBSITETOKEN != '' }}
run: |

1
.gitignore vendored
View file

@ -1 +1,2 @@
*~
node_modules

4
.husky/pre-commit Executable file
View file

@ -0,0 +1,4 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"
pnpm exec lint-staged

2
.npmrc Normal file
View file

@ -0,0 +1,2 @@
# Expose `remark-cli` for `pnpm` users
shamefully-hoist=true

3
.prettierignore Normal file
View file

@ -0,0 +1,3 @@
node_modules
pnpm-lock.yaml
.pnpm-store

16
.prettierrc Normal file
View file

@ -0,0 +1,16 @@
{
"printWidth": 120,
"semi": true,
"singleQuote": true,
"tabWidth": 2,
"trailingComma": "es5",
"useTabs": true,
"overrides": [
{
"files": ["*.json", "*.md", "*.toml", "*.yml"],
"options": {
"useTabs": false
}
}
]
}

3
.vscode/extensions.json vendored Normal file
View file

@ -0,0 +1,3 @@
{
"recommendations": ["unifiedjs.vscode-remark", "esbenp.prettier-vscode"]
}

View file

@ -552,7 +552,7 @@ And the following unique queues:
- lower - use one or more lower latin characters
- upper - use one or more upper latin characters
- digit - use one or more digits
- spec - use one or more special characters as `` !"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~ ``
- spec - use one or more special characters as ``!"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~``
- off - do not check password complexity
- `PASSWORD_CHECK_PWN`: **false**: Check [HaveIBeenPwned](https://haveibeenpwned.com/Passwords) to see if a password has been exposed.
- `SUCCESSFUL_TOKENS_CACHE_SIZE`: **20**: Cache successful token hashes. API tokens are stored in the DB as pbkdf2 hashes however, this means that there is a potentially significant hashing load when there are multiple API operations. This cache will store the successfully hashed tokens in a LRU cache as a balance between performance and security.

51
package.json Normal file
View file

@ -0,0 +1,51 @@
{
"name": "docs",
"version": "0.0.0",
"description": "Forgejo Documentation",
"author": "Forgejo Contributors",
"license": "CC-BY-SA-4.0",
"private": true,
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"lint:remark": "remark . --quiet --frail",
"lint:prettier": "prettier --check .",
"format:remark": "remark . --quiet --frail --output",
"format:prettier": "prettier -w --cache .",
"prepare": "husky install"
},
"lint-staged": {
"*.md": "remark --quiet --frail",
"*": "prettier -w --cache --ignore-unknown"
},
"remarkConfig": {
"plugins": [
"remark-frontmatter",
"remark-preset-lint-consistent",
"remark-preset-lint-recommended",
[
"remark-lint-list-item-indent",
"space"
],
[
"remark-lint-heading-style",
"atx"
],
[
"remark-lint-no-undefined-references",
false
]
]
},
"devDependencies": {
"husky": "^8.0.3",
"lint-staged": "^14.0.0",
"prettier": "^3.0.2",
"remark-cli": "^11.0.0",
"remark-frontmatter": "^4.0.1",
"remark-lint-heading-style": "^3.1.2",
"remark-lint-list-item-indent": "^3.1.2",
"remark-lint-no-undefined-references": "^4.2.1",
"remark-preset-lint-consistent": "^5.1.2",
"remark-preset-lint-recommended": "^6.1.3"
}
}

1944
pnpm-lock.yaml Normal file

File diff suppressed because it is too large Load diff