-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #86 from Azure/add-linter
Add linter and link checker
- Loading branch information
Showing
4 changed files
with
115 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
--- | ||
dirs: | ||
- ./ | ||
#baseUrl: https://example.com | ||
# ignorePatterns: | ||
# - pattern: '^https://example.com/skip/.*$' | ||
# - pattern: "^(ftp)://[^\\s/$?#]*\\.[^\\s]*$" | ||
# replacementPatterns: | ||
# - pattern: "(https?://example.com)/(\\w+)/(\\d+)" | ||
# replacement: '$1/id/$3' | ||
# - pattern: "\\[([^\\]]+)\\]\\((https?://example.com)/file\\)" | ||
# replacement: '<a href="$2/file">$1</a>' | ||
aliveStatusCodes: | ||
- 200 | ||
- 201 | ||
- 204 | ||
useGitIgnore: true | ||
modifiedFilesOnly: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
--- | ||
########################### | ||
########################### | ||
## Markdown Linter rules ## | ||
########################### | ||
########################### | ||
|
||
# Linter rules doc: | ||
# - https://github.com/DavidAnson/markdownlint | ||
# | ||
# Note: | ||
# To comment out a single error: | ||
# <!-- markdownlint-disable --> | ||
# any violations you want | ||
# <!-- markdownlint-restore --> | ||
# | ||
|
||
############### | ||
# Rules by id # | ||
############### | ||
MD004: false # Unordered list style | ||
MD007: | ||
indent: 2 # Unordered list indentation | ||
MD013: | ||
line_length: 900 # Line length 80 is far to short | ||
MD026: | ||
punctuation: ".,;:!。,;:" # List of not allowed | ||
MD029: false # Ordered list item prefix | ||
MD033: false # Allow inline HTML | ||
MD036: false # Emphasis used instead of a heading | ||
|
||
################# | ||
# Rules by tags # | ||
################# | ||
blank_lines: false # Error on blank lines |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
--- | ||
rules: | ||
line-length: | ||
max: 150 | ||
allow-non-breakable-words: true | ||
allow-non-breakable-inline-mappings: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
--- | ||
name: Code Review - Linting & Link Checks | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- main | ||
workflow_dispatch: {} | ||
|
||
jobs: | ||
lint: | ||
name: Lint code base | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Run github/super-linter | ||
uses: github/[email protected] | ||
env: | ||
# Lint all code - disabled in as part of #262 | ||
VALIDATE_ALL_CODEBASE: false | ||
# Need to define main branch as default is set to master in super-linter | ||
DEFAULT_BRANCH: main | ||
# Enable setting the status of each individual linter run in the Checks section of a pull request | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
# The following linter types will be enabled: | ||
VALIDATE_JSON: true | ||
VALIDATE_MARKDOWN: true | ||
VALIDATE_POWERSHELL: true | ||
VALIDATE_YAML: true | ||
#YAMLLINT_CONFIG_FILE: .github/linters/.yamllint.yml | ||
#VALIDATE_EDITORCONFIG: true | ||
# Disable errors to only generate a report | ||
#DISABLE_ERRORS: true | ||
|
||
markdown-link-check: | ||
name: Markdown Link Check | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@master | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Run linkspector | ||
uses: umbrelladocs/[email protected] | ||
with: | ||
github_token: ${{ secrets.github_token }} | ||
reporter: github-pr-review | ||
fail_on_error: true | ||
config_file: ".github/actions-config/.linkspector.yml" |