forked from matter-labs/zksync-era
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: adds
zk linkcheck
to zk tool and updates zk env for `zk linkc…
…heck` ci usage (matter-labs#868) Related PRs: - matter-labs#869 - matter-labs#870 ## What ❔ - Adds `zk linkcheck` to zk tool - Adds required dependencies to make use of `zk linkcheck` in zk env - Adds `zk linkcheck` docs - Updates `spellcheck` dir to be general `checks-config` dir to include spellcheck and link configuration files - Fixes issue with `zk spellcheck` exit code <!-- What are the changes this PR brings about? --> <!-- Example: This PR adds a PR template to the repo. --> <!-- (For bigger PRs adding more context is appreciated) --> ## Why ❔ - `zk linkcheck` will ensure no dead links exist in repo and prevent unnecessary PRs - Required to install dependencies, similar to `zk spellcheck` - Relevant docs to outline `zk linkcheck` usage <!-- Why are these changes done? What goal do they contribute to? What are the principles behind them? --> <!-- Example: PR templates ensure PR reviewers, observers, and future iterators are in context about the evolution of repos. --> ## Checklist <!-- Check your PR fulfills the following items. --> <!-- For draft PRs check the boxes as you complete them. --> - [x] PR title corresponds to the body of PR (we generate changelog entries from PRs). - [ ] Tests for the changes have been added / updated. - [x] Documentation comments have been added / updated. - [x] Code has been formatted via `zk fmt` and `zk lint`. - [x] Spellcheck has been run via `zk spellcheck`.
- Loading branch information
1 parent
c7d4c24
commit d64f584
Showing
15 changed files
with
86 additions
and
13 deletions.
There are no files selected for viewing
File renamed without changes.
File renamed without changes.
File renamed without changes.
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,29 @@ | ||
{ | ||
"ignorePatterns": [ | ||
{ | ||
"pattern": "^https://github\\.com/matter-labs/zksync-2-dev/" | ||
}, | ||
{ | ||
"pattern": "^https://www\\.notion\\.so/" | ||
}, | ||
{ | ||
"pattern": "^https://github\\.com/matter-labs/zksync-era/compare/" | ||
}, | ||
{ | ||
"pattern": "^https://twitter\\.com/zksync" | ||
}, | ||
{ | ||
"pattern": "^https://twitter\\.com/zkSyncDevs" | ||
}, | ||
{ | ||
"pattern": "^https://github\\.com/matter-labs/zk_evm" | ||
}, | ||
{ | ||
"pattern": "^https://sepolia\\.etherscan\\.io/tx/0x18c2a113d18c53237a4056403047ff9fafbf772cb83ccd44bb5b607f8108a64c" | ||
}, | ||
{ | ||
"pattern": "^https://github\\.com/matter-labs/zksync-era/commit/" | ||
} | ||
], | ||
"aliveStatusCodes": [0, 200, 206, 304] | ||
} |
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
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
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
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
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
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
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
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
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
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,25 @@ | ||
import { Command } from 'commander'; | ||
import * as utils from './utils'; | ||
|
||
export async function runMarkdownLinkCheck(configPath: string) { | ||
// Command line usage for markdown-link-check suggests using find and xargs for | ||
// recursive checks. See: `https://github.com/tcort/markdown-link-check?tab=readme-ov-file#check-links-from-a-local-markdown-folder-recursive` | ||
const findCommand = `find . -name "*.md" ! -path "*/node_modules/*" ! -path "*/target/release/*" ! -path "*/build/*" ! -path "*/contracts/*" -print0`; | ||
const markdownLinkCheckCommand = `xargs -0 -n1 markdown-link-check --config ${configPath}`; | ||
const fullCommand = `${findCommand} | ${markdownLinkCheckCommand}`; | ||
|
||
try { | ||
await utils.spawn(fullCommand); | ||
console.log('Markdown link check completed successfully'); | ||
} catch (error) { | ||
console.error('Error occurred during markdown link checking:', error); | ||
process.exit(1); | ||
} | ||
} | ||
|
||
export const command = new Command('linkcheck') | ||
.option('--config <config>', 'Path to configuration file', './checks-config/links.json') | ||
.description('Run markdown link check on specified files') | ||
.action((cmd) => { | ||
runMarkdownLinkCheck(cmd.config); | ||
}); |
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