mirror of
https://codeberg.org/forgejo/docs.git
synced 2024-11-20 17:26:56 -05:00
add linting for docs markdown content
This commit is contained in:
parent
8b922f661d
commit
4e059dc7f9
11 changed files with 2034 additions and 7 deletions
|
@ -10,6 +10,9 @@ indent_size = 2
|
||||||
indent_style = tab
|
indent_style = tab
|
||||||
insert_final_newline = true
|
insert_final_newline = true
|
||||||
|
|
||||||
|
[*.json]
|
||||||
|
indent_style = space
|
||||||
|
|
||||||
[*.md]
|
[*.md]
|
||||||
indent_style = space
|
indent_style = space
|
||||||
trim_trailing_whitespace = false
|
trim_trailing_whitespace = false
|
||||||
|
|
|
@ -10,6 +10,12 @@ jobs:
|
||||||
image: node:20
|
image: node:20
|
||||||
steps:
|
steps:
|
||||||
- uses: https://code.forgejo.org/actions/checkout@v3
|
- 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
|
- name: get forgejo.org and move the docs
|
||||||
run: |
|
run: |
|
||||||
git clone --recursive --depth 1 https://codeberg.org/forgejo/website/ /tmp/website
|
git clone --recursive --depth 1 https://codeberg.org/forgejo/website/ /tmp/website
|
||||||
|
@ -20,12 +26,6 @@ jobs:
|
||||||
cd /tmp/website
|
cd /tmp/website
|
||||||
corepack enable
|
corepack enable
|
||||||
pnpm install --frozen-lockfile
|
pnpm install --frozen-lockfile
|
||||||
- name: lint:eslint
|
|
||||||
run: |
|
|
||||||
cd /tmp/website
|
|
||||||
corepack enable
|
|
||||||
pnpm run format-ci
|
|
||||||
pnpm run lint:eslint
|
|
||||||
- name: preview
|
- name: preview
|
||||||
if: ${{ secrets.WEBSITETOKEN != '' }}
|
if: ${{ secrets.WEBSITETOKEN != '' }}
|
||||||
run: |
|
run: |
|
||||||
|
|
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -1 +1,2 @@
|
||||||
*~
|
*~
|
||||||
|
node_modules
|
||||||
|
|
4
.husky/pre-commit
Executable file
4
.husky/pre-commit
Executable file
|
@ -0,0 +1,4 @@
|
||||||
|
#!/usr/bin/env sh
|
||||||
|
. "$(dirname -- "$0")/_/husky.sh"
|
||||||
|
|
||||||
|
pnpm exec lint-staged
|
2
.npmrc
Normal file
2
.npmrc
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
# Expose `remark-cli` for `pnpm` users
|
||||||
|
shamefully-hoist=true
|
3
.prettierignore
Normal file
3
.prettierignore
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
node_modules
|
||||||
|
pnpm-lock.yaml
|
||||||
|
.pnpm-store
|
16
.prettierrc
Normal file
16
.prettierrc
Normal 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
3
.vscode/extensions.json
vendored
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
{
|
||||||
|
"recommendations": ["unifiedjs.vscode-remark", "esbenp.prettier-vscode"]
|
||||||
|
}
|
|
@ -552,7 +552,7 @@ And the following unique queues:
|
||||||
- lower - use one or more lower latin characters
|
- lower - use one or more lower latin characters
|
||||||
- upper - use one or more upper latin characters
|
- upper - use one or more upper latin characters
|
||||||
- digit - use one or more digits
|
- 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
|
- off - do not check password complexity
|
||||||
- `PASSWORD_CHECK_PWN`: **false**: Check [HaveIBeenPwned](https://haveibeenpwned.com/Passwords) to see if a password has been exposed.
|
- `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.
|
- `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
51
package.json
Normal 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
1944
pnpm-lock.yaml
Normal file
File diff suppressed because it is too large
Load diff
Loading…
Reference in a new issue