diff --git a/.markdownlinkcheck.json b/.github/.markdownlinkcheck.json similarity index 100% rename from .markdownlinkcheck.json rename to .github/.markdownlinkcheck.json diff --git a/.markdownlint-cli2.jsonc b/.github/.markdownlint-cli2.jsonc similarity index 84% rename from .markdownlint-cli2.jsonc rename to .github/.markdownlint-cli2.jsonc index a988fd4b594..fd035c87ffa 100644 --- a/.markdownlint-cli2.jsonc +++ b/.github/.markdownlint-cli2.jsonc @@ -1,6 +1,6 @@ { "config": { - "extends": "./.markdownlint.jsonc" + "extends": "../.github/.markdownlint.jsonc" }, "globs": [ "**/*.md" @@ -8,4 +8,4 @@ "customRules": ["markdownlint-rule-search-replace"], "ignores": ["node_modules", ".git", ".github", "src", "Crackmes", "Samples", "docs/contributing/5_Style_Guide.md", "venv", "playground"], "gitignore": true -} \ No newline at end of file +} diff --git a/.github/.markdownlint.jsonc b/.github/.markdownlint.jsonc new file mode 100644 index 00000000000..c4e62b17694 --- /dev/null +++ b/.github/.markdownlint.jsonc @@ -0,0 +1,64 @@ +{ + // https://github.com/DavidAnson/markdownlint/blob/main/doc/Rules.md + + "MD004": {"style": "dash"}, // ul-style + "MD007": { "indent": 4 }, // ul-indent + "MD013": false, // line-length + "MD014": false, // commands-show-output + "MD024": {"siblings_only": true}, // no-duplicate-header + "MD026": {"punctuation": ".,;:"}, // no-trailing-punctuation (allows !?) + "MD033": false, // no-inline-html + "MD035": {"style": "---"}, // hr-style + "MD036": {"punctuation": ".,;:!。"}, // no-emphasis-as-header + "MD041": false, // first-line-h1 + "MD045": false, // no-alt-text + "MD046": false, // code-block-style (unsupported admonitions) + "MD049": {"style": "underscore"}, // emphasis-style + "MD050": {"style": "asterisk"}, // strong-style + "MD055": {"style": "leading_and_trailing"}, // table-pipe-style + "search-replace": { + "rules": [ + { + "name": "curly-double-quotes", + "message": "Do not use curly double quotes.", + "searchPattern": "/“|”/g", + "replace": "\"", + "searchScope": "text" + }, + { + "name": "nbsp", + "message": "Don't use no-break spaces", + "searchPattern": "/ /g", + "replace": " ", + "searchScope": "all" + }, + { + "name": "curly-single-quotes", + "message": "Don't use curly single quotes", + "searchPattern": "/‘|’/g", + "replace": "'", + "searchScope": "text" + }, + { + "name": "gender-neutrality", + "message": "Ensure gender-neutral language is used.", + "searchPattern": "/\\bhe\\b|\\bshe\\b|\\bhis\\b|\\bhimself\\b|\\bherself\\b|\\bher\\b|\\bhim\\b|\\bhers\\b/g", + "replace": "" + }, + { + "name": "trailing-spaces", + "message": "Avoid trailing spaces", + "searchPattern": "/ +$/gm", + "replace": "", + "searchScope": "all", + }, + { + "name": "double-spaces", + "message": "Avoid double spaces", + "searchPattern": "/([^\\s>]) ([^\\s|])/g", + "replace": "$1 $2", + "searchScope": "text" + } + ] + } + } diff --git a/.github/workflows/markdown-linter.yml b/.github/workflows/markdown-linter.yml index 776ab3ead88..23aa7a58c95 100644 --- a/.github/workflows/markdown-linter.yml +++ b/.github/workflows/markdown-linter.yml @@ -20,5 +20,5 @@ jobs: - name: markdownlint-cli2 uses: DavidAnson/markdownlint-cli2-action@v16.0.0 with: - config: ".markdownlint.jsonc" + config: ".github/.markdownlint.jsonc" diff --git a/.markdownlint.jsonc b/.markdownlint.jsonc deleted file mode 100644 index 39841127a9e..00000000000 --- a/.markdownlint.jsonc +++ /dev/null @@ -1,174 +0,0 @@ -{ - // https://github.com/DavidAnson/markdownlint/blob/main/doc/Rules.md - - "MD004": {"style": "dash"}, // ul-style - "MD007": { "indent": 4 }, // ul-indent - "MD013": false, // line-length - "MD014": false, // commands-show-output - "MD024": {"siblings_only": true}, // no-duplicate-header - "MD026": {"punctuation": ".,;:"}, // no-trailing-punctuation (allows !?) - "MD033": false, // no-inline-html - "MD035": {"style": "---"}, // hr-style - "MD036": {"punctuation": ".,;:!。"}, // no-emphasis-as-header - "MD041": false, // first-line-h1 - "MD045": false, // no-alt-text - "MD046": false, // code-block-style (unsupported admonitions) - "MD049": {"style": "underscore"}, // emphasis-style - "MD050": {"style": "asterisk"}, // strong-style - "MD055": {"style": "leading_and_trailing"}, // table-pipe-style - "search-replace": { - "rules": [ - { - "name": "curly-double-quotes", - "message": "Do not use curly double quotes.", - "searchPattern": "/“|”/g", - "replace": "\"", - "searchScope": "text" - }, - { - "name": "nbsp", - "message": "Don't use no-break spaces", - "searchPattern": "/ /g", - "replace": " ", - "searchScope": "all" - }, - { - "name": "curly-single-quotes", - "message": "Don't use curly single quotes", - "searchPattern": "/‘|’/g", - "replace": "'", - "searchScope": "text" - }, - { - "name": "gender-neutrality", - "message": "Ensure gender-neutral language is used.", - "searchPattern": "/\\bhe\\b|\\bshe\\b|\\bhis\\b|\\bhimself\\b|\\bherself\\b|\\bher\\b|\\bhim\\b|\\bhers\\b/g", - "replace": "" - }, - { - "name": "trailing-spaces", - "message": "Avoid trailing spaces", - "searchPattern": "/ +$/gm", - "replace": "", - "searchScope": "all", - }, - { - "name": "double-spaces", - "message": "Avoid double spaces", - "searchPattern": "/([^\\s>]) ([^\\s|])/g", - "replace": "$1 $2", - "searchScope": "text" - }, - // { - // "name": "correct-noun-forms", - // "message": "Use the correct form for specific terms.", - // "searchPattern": [ - // "/\\bMacOS\\b/g", - // "/\\bAppStore\\b/g", - // "/\\bBackEnd\\b/g", - // "/\\bbase64\\b/g", - // "/\\bBlackBox\\b/g", - // "/\\bBundleID\\b/g", - // "/\\bBytecode\\b/g", - // "/\\bClientSide\\b/g", - // "/\\bCodeBase\\b/g", - // "/\\bCodeSigning\\b/g", - // "/\\bCommandLine\\b/g", - // "/\\bDisassembler\\b/g", - // "/\\bEndUsers\\b/g", - // "/\\bFileName\\b/g", - // "/\\bMac OS\\b/g", - // "/\\bPentest\\b/g", - // "/\\bPhonegap\\b/g", - // "/\\bPython\\b/g", - // "/\\bRepackage\\b/g", - // "/\\bRun time\\b/g", - // "/\\brun time\\b/g", - // "/\\bServerSide\\b/g", - // "/\\bSnapshotLength\\b/g", - // "/\\bUseCase\\b/g", - // "/\\bWiFi\\b/g", - // "/\\bWhiteBox\\b/g" - // ], - // "replace": [ - // "macOS", - // "App Store", - // "backend", - // "Base64", - // "black box", - // "Bundle ID", - // "bytecode", - // "client side", - // "codebase", - // "code signing", - // "command line", - // "disassembler", - // "end users", - // "file name", - // "macOS", - // "pentest", - // "PhoneGap", - // "Python", - // "repackage", - // "Runtime", - // "runtime", - // "server side", - // "snapshot length", - // "use case", - // "Wi-Fi", - // "white box" - // ], - // "searchScope": "text" - // }, - // { - // "name": "contractions", - // "message": "Use contractions where appropriate", - // "searchPattern": [ - // "/\\bare not\\b/g", - // "/\\bcannot\\b/g", - // "/\\bcould not\\b/g", - // "/\\bdid not\\b/g", - // "/\\bdo not\\b/g", - // "/\\bdoes not\\b/g", - // "/\\bhas not\\b/g", - // "/\\bhad not\\b/g", - // "/\\bhave not\\b/g", - // "/\\bis not\\b/g", - // "/\\bit is\\b/g", - // "/\\bthat is\\b/g", - // "/\\bthere is\\b/g", - // "/\\bwas not\\b/g", - // "/\\bwere not\\b/g", - // "/\\bwill not\\b/g", - // "/\\bwould not\\b/g", - // "/\\byou are\\b/g", - // "/\\byou have\\b/g", - // "/\\byou will\\b/g" - // ], - // "replace": [ - // "aren't", - // "can't", - // "couldn't", - // "didn't", - // "don't", - // "doesn't", - // "hasn't", - // "hadn't", - // "haven't", - // "isn't", - // "it's", - // "that's", - // "there's", - // "wasn't", - // "weren't", - // "won't", - // "wouldn't", - // "you're", - // "you've", - // "you'll" - // ], - // "searchScope": "text" - // }, - ] - } - } diff --git a/.vscode/settings.json b/.vscode/settings.json index 1372ed7448d..f69dc8a512d 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,4 +1,5 @@ { + "markdownlint.configFile": ".github/.markdownlint.jsonc", "workbench.colorCustomizations": { "activityBar.activeBackground": "#7cbaff", "activityBar.activeBorder": "#df006a", diff --git a/src/README.md b/src/README.md index f798164463b..fbb18c17864 100644 --- a/src/README.md +++ b/src/README.md @@ -18,7 +18,7 @@ Usually we don't have to change anything here apart from upgrading the version o - **Document** (`.github/workflows/docgenerator.yml`) generates: - the MAS Checklist using `src/scripts/yaml_to_excel.py` - **Build Website** (`.github/workflows/build-website.yml`): builds the website and pushes the result to the `gh-pages` branch. -- **Markdown Linter** (`.github/workflows/markdown-linter.yml`): runs a markdown linter using our config `.markdownlint.json` (more about [configuration](https://github.com/igorshubovych/markdownlint-cli#configuration)). +- **Markdown Linter** (`.github/workflows/markdown-linter.yml`): runs a markdown linter using our config `.github/.markdownlint.jsonc` (more about [configuration](https://github.com/igorshubovych/markdownlint-cli#configuration)). - **URLs Checker** (`.github/workflows/url-checker.yml`, `.github/workflows/url-checker-pr.yml`): runs a URL checker using our config `.github/workflows/config/url-checker-config.json` (this workflow usually gives false positives that we have to exclude in the config). - **Spell Checker** (`.github/workflows/spell-checker.yml`): runs a spell checker - **CodeQL Security Scan** (`.github/workflows/codeql-analysis.yml`): to detect security issues in our Python code.