forked from cvat-ai/cvat
-
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.
Fix all remark warnings (cvat-ai#3261)
* Fix all issues reported by remark * Move remark dependencies from the workflow definition into package.json This enables the transitive dependencies to be pinned, just like for all other packages. * Add additional remark plugins These are needed to correctly parse certain constructs in Markdown files (such as tables and YAML frontmatter), and without them, remark produces invalid warnings on some files. * Update the remark-lint preset versions The previous versions reference the old version of the `remark-lint-table-cell-padding` plugin, which doesn't work correctly with the current version of `remark-parse` (and thus produces spurious warnings). * GitHub Actions: run remark on all Markdown files, not just changed ones This way, if a PR updates the remark configuration and that causes new errors to appear, those errors will show up in that PR, instead of the (unrelated) PR that next updates the affected files. There is no runtime cost to this, because remark takes approximately 1 second to check all files.
- Loading branch information
Roman Donchenko
authored
May 31, 2021
1 parent
4960260
commit 2597546
Showing
49 changed files
with
1,385 additions
and
725 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 |
---|---|---|
|
@@ -11,31 +11,16 @@ jobs: | |
|
||
- name: Run checks | ||
run: | | ||
URL="https://api.github.com/repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}/files" | ||
PR_FILES=$(curl -s -X GET -G $URL | jq -r '.[] | select(.status != "removed") | .filename') | ||
for files in $PR_FILES; do | ||
extension="${files##*.}" | ||
if [[ $extension == 'md' ]]; then | ||
changed_files_remark+=" ${files}" | ||
fi | ||
done | ||
npm ci | ||
mkdir -p remark_report | ||
if [[ ! -z ${changed_files_remark} ]]; then | ||
npm ci | ||
npm install [email protected] [email protected] | ||
mkdir -p remark_report | ||
echo "Remark version: "`npx remark --version` | ||
echo "The files will be checked: "`echo ${changed_files_remark}` | ||
npx remark --quiet --report json --no-stdout ${changed_files_remark} 2> ./remark_report/remark_report.json | ||
get_report=`cat ./remark_report/remark_report.json | jq -r '.[] | select(.messages | length > 0)'` | ||
if [[ ! -z ${get_report} ]]; then | ||
pip install json2html | ||
python ./tests/json_to_html.py ./remark_report/remark_report.json | ||
exit 1 | ||
fi | ||
else | ||
echo "No files with the \"md\" extension found" | ||
echo "Remark version: "`npx remark --version` | ||
npx remark --quiet --report json --no-stdout . 2> ./remark_report/remark_report.json | ||
get_report=`cat ./remark_report/remark_report.json | jq -r '.[] | select(.messages | length > 0)'` | ||
if [[ ! -z ${get_report} ]]; then | ||
pip install json2html | ||
python ./tests/json_to_html.py ./remark_report/remark_report.json | ||
exit 1 | ||
fi | ||
- name: Upload artifacts | ||
|
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
Large diffs are not rendered by default.
Oops, something went wrong.
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
Oops, something went wrong.