Skip to content

Commit 2597546

Browse files
author
Roman Donchenko
authored
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.
1 parent 4960260 commit 2597546

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+1385
-725
lines changed

.github/workflows/remark.yml

+9-24
Original file line numberDiff line numberDiff line change
@@ -11,31 +11,16 @@ jobs:
1111

1212
- name: Run checks
1313
run: |
14-
URL="https://api.github.com/repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}/files"
15-
PR_FILES=$(curl -s -X GET -G $URL | jq -r '.[] | select(.status != "removed") | .filename')
16-
for files in $PR_FILES; do
17-
extension="${files##*.}"
18-
if [[ $extension == 'md' ]]; then
19-
changed_files_remark+=" ${files}"
20-
fi
21-
done
14+
npm ci
15+
mkdir -p remark_report
2216
23-
if [[ ! -z ${changed_files_remark} ]]; then
24-
npm ci
25-
26-
mkdir -p remark_report
27-
28-
echo "Remark version: "`npx remark --version`
29-
echo "The files will be checked: "`echo ${changed_files_remark}`
30-
npx remark --quiet --report json --no-stdout ${changed_files_remark} 2> ./remark_report/remark_report.json
31-
get_report=`cat ./remark_report/remark_report.json | jq -r '.[] | select(.messages | length > 0)'`
32-
if [[ ! -z ${get_report} ]]; then
33-
pip install json2html
34-
python ./tests/json_to_html.py ./remark_report/remark_report.json
35-
exit 1
36-
fi
37-
else
38-
echo "No files with the \"md\" extension found"
17+
echo "Remark version: "`npx remark --version`
18+
npx remark --quiet --report json --no-stdout . 2> ./remark_report/remark_report.json
19+
get_report=`cat ./remark_report/remark_report.json | jq -r '.[] | select(.messages | length > 0)'`
20+
if [[ ! -z ${get_report} ]]; then
21+
pip install json2html
22+
python ./tests/json_to_html.py ./remark_report/remark_report.json
23+
exit 1
3924
fi
4025
4126
- name: Upload artifacts

.remarkrc.js

+2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
exports.settings = { bullet: '*', paddedTable: false };
22

33
exports.plugins = [
4+
'remark-frontmatter',
5+
'remark-gfm',
46
'remark-preset-lint-recommended',
57
'remark-preset-lint-consistent',
68
['remark-lint-list-item-indent', 'space'],

CHANGELOG.md

+82-82
Large diffs are not rendered by default.

CONTRIBUTING.md

+40-40
Original file line numberDiff line numberDiff line change
@@ -300,13 +300,13 @@ Good bug reports are extremely helpful - thank you!
300300

301301
Guidelines for bug reports:
302302

303-
1. **Use the GitHub issue search** — check if the issue has already been
304-
reported.
303+
1. **Use the GitHub issue search** — check if the issue has already been
304+
reported.
305305

306-
1. **Check if the issue has been fixed** — try to reproduce it using the
307-
latest `develop` branch in the repository.
306+
1. **Check if the issue has been fixed** — try to reproduce it using the
307+
latest `develop` branch in the repository.
308308

309-
1. **Isolate the problem** — ideally create a reduced test case.
309+
1. **Isolate the problem** — ideally create a reduced test case.
310310

311311
A good bug report shouldn't leave others needing to chase you up for more
312312
information. Please try to be as detailed as possible in your report. What is
@@ -358,52 +358,52 @@ accurate comments, etc.) and any other requirements (such as test coverage).
358358
Follow this process if you'd like your work considered for inclusion in the
359359
project:
360360

361-
1. [Fork](https://docs.github.com/en/github/getting-started-with-github/fork-a-repo) the project, clone your fork,
362-
and configure the remotes:
361+
1. [Fork](https://docs.github.com/en/github/getting-started-with-github/fork-a-repo) the project, clone your fork,
362+
and configure the remotes:
363363

364-
```bash
365-
# Clone your fork of the repo into the current directory
366-
git clone https://github.com/<your-username>/<repo-name>
367-
# Navigate to the newly cloned directory
368-
cd <repo-name>
369-
# Assign the original repo to a remote called "upstream"
370-
git remote add upstream https://github.com/<upstream-owner>/<repo-name>
371-
```
364+
```bash
365+
# Clone your fork of the repo into the current directory
366+
git clone https://github.com/<your-username>/<repo-name>
367+
# Navigate to the newly cloned directory
368+
cd <repo-name>
369+
# Assign the original repo to a remote called "upstream"
370+
git remote add upstream https://github.com/<upstream-owner>/<repo-name>
371+
```
372372

373-
1. If you cloned a while ago, get the latest changes from upstream:
373+
1. If you cloned a while ago, get the latest changes from upstream:
374374

375-
```bash
376-
git checkout <dev-branch>
377-
git pull upstream <dev-branch>
378-
```
375+
```bash
376+
git checkout <dev-branch>
377+
git pull upstream <dev-branch>
378+
```
379379

380-
1. Create a new topic branch (off the main project development branch) to
381-
contain your feature, change, or fix:
380+
1. Create a new topic branch (off the main project development branch) to
381+
contain your feature, change, or fix:
382382

383-
```bash
384-
git checkout -b <topic-branch-name>
385-
```
383+
```bash
384+
git checkout -b <topic-branch-name>
385+
```
386386

387-
1. Commit your changes in logical chunks. Please adhere to these [git commit
388-
message guidelines](http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html)
389-
or your code is unlikely be merged into the main project. Use Git's
390-
[interactive rebase](https://docs.github.com/en/github/using-git/about-git-rebase)
391-
feature to tidy up your commits before making them public.
387+
1. Commit your changes in logical chunks. Please adhere to these [git commit
388+
message guidelines](http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html)
389+
or your code is unlikely be merged into the main project. Use Git's
390+
[interactive rebase](https://docs.github.com/en/github/using-git/about-git-rebase)
391+
feature to tidy up your commits before making them public.
392392

393-
1. Locally merge (or rebase) the upstream development branch into your topic branch:
393+
1. Locally merge (or rebase) the upstream development branch into your topic branch:
394394

395-
```bash
396-
git pull [--rebase] upstream <dev-branch>
397-
```
395+
```bash
396+
git pull [--rebase] upstream <dev-branch>
397+
```
398398

399-
1. Push your topic branch up to your fork:
399+
1. Push your topic branch up to your fork:
400400

401-
```bash
402-
git push origin <topic-branch-name>
403-
```
401+
```bash
402+
git push origin <topic-branch-name>
403+
```
404404

405-
1. [Open a Pull Request](hhttps://docs.github.com/en/github/collaborating-with-issues-and-pull-requests/about-pull-requests)
406-
with a clear title and description.
405+
1. [Open a Pull Request](hhttps://docs.github.com/en/github/collaborating-with-issues-and-pull-requests/about-pull-requests)
406+
with a clear title and description.
407407

408408
**IMPORTANT**: By submitting a patch, you agree to allow the project owner to
409409
license your work under the same license as that used by the project.

cvat-data/src/js/3rdparty/README.md

+42-42
Original file line numberDiff line numberDiff line change
@@ -17,52 +17,52 @@ So, we have solved to write patch file for this library.
1717
It modifies source code a little to support our scenario of using.
1818

1919
### How to build awc.wasm and Decoder.js
20-
1. Clone Emscripten SDK, install and activate the latest fastcomp SDK:
21-
```sh
22-
git clone https://github.com/emscripten-core/emsdk.git && cd emsdk
23-
```
24-
```sh
25-
./emsdk install latest-fastcomp
26-
```
27-
```sh
28-
./emsdk activate latest-fastcomp
29-
```
20+
1. Clone Emscripten SDK, install and activate the latest fastcomp SDK:
21+
```sh
22+
git clone https://github.com/emscripten-core/emsdk.git && cd emsdk
23+
```
24+
```sh
25+
./emsdk install latest-fastcomp
26+
```
27+
```sh
28+
./emsdk activate latest-fastcomp
29+
```
3030

31-
1. Clone Broadway.js
32-
```sh
33-
git clone https://github.com/mbebenita/Broadway.git && cd Broadway/Decoder
34-
```
31+
1. Clone Broadway.js
32+
```sh
33+
git clone https://github.com/mbebenita/Broadway.git && cd Broadway/Decoder
34+
```
3535

36-
1. Edit `make.py`:
37-
- Remove or comment the following options:
38-
`'-s', 'NO_BROWSER=1',`\
39-
`'-s', 'PRECISE_I64_MATH=0',`
40-
- Remove `"HEAP8", "HEAP16", "HEAP32"` from the `EXPORTED_FUNCTIONS` list.
41-
- Increase total memory to make possible decode 4k videos
42-
(or try to enable `ALLOW_MEMORY_GROWTH`, but this option has not been tested):\
43-
`'-s', 'TOTAL_MEMORY=' + str(100*1024*1024),`
44-
- Add the following options:\
45-
`'-s', "ENVIRONMENT='worker'",`\
46-
`'-s', 'WASM=1',`
36+
1. Edit `make.py`:
37+
- Remove or comment the following options:
38+
`'-s', 'NO_BROWSER=1',`\
39+
`'-s', 'PRECISE_I64_MATH=0',`
40+
- Remove `"HEAP8", "HEAP16", "HEAP32"` from the `EXPORTED_FUNCTIONS` list.
41+
- Increase total memory to make possible decode 4k videos
42+
(or try to enable `ALLOW_MEMORY_GROWTH`, but this option has not been tested):\
43+
`'-s', 'TOTAL_MEMORY=' + str(100*1024*1024),`
44+
- Add the following options:\
45+
`'-s', "ENVIRONMENT='worker'",`\
46+
`'-s', 'WASM=1',`
4747

48-
1. Activate emsdk environment and build Broadway.js:
49-
```sh
50-
. /tmp/emsdk/emsdk_env.sh
51-
```
52-
```sh
53-
python2 make.py
54-
```
48+
1. Activate emsdk environment and build Broadway.js:
49+
```sh
50+
. /tmp/emsdk/emsdk_env.sh
51+
```
52+
```sh
53+
python2 make.py
54+
```
5555

56-
1. Copy the following files to cvat-data 3rdparty source folder:
57-
```sh
58-
cd ..
59-
```
60-
```sh
61-
cp Player/avc.wasm Player/Decoder.js Player/mp4.js <CVAT_FOLDER>/cvat-data/src/
62-
```
63-
```sh
64-
js/3rdparty
65-
```
56+
1. Copy the following files to cvat-data 3rdparty source folder:
57+
```sh
58+
cd ..
59+
```
60+
```sh
61+
cp Player/avc.wasm Player/Decoder.js Player/mp4.js <CVAT_FOLDER>/cvat-data/src/
62+
```
63+
```sh
64+
js/3rdparty
65+
```
6666

6767
### How work with a patch file
6868
```bash

cvat/apps/dataset_repo/README.md

+4-2
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,12 @@ The SSH protocol is used for an authorization.
88

99
### Using
1010

11-
- Put a private SSH key into the `ssh` directory. The public key corresponding to this private key should be attached to an github user.
11+
- Put a private SSH key into the `ssh` directory.
12+
The public key corresponding to this private key should be attached to an github user.
1213
- If you don't put any custom key, it will generated automatically.
1314
- Setup a repository URL and a path (which is relative for a repository) in the create task dialog.
1415
- Annotate a task.
1516
- Press the button "Git Repository Sync" on the dashboard.
1617
- In the dialog window press the button "Sync" and waiting for some time.
17-
- An annotation will be dumped, archived and pushed to the attached remote repository. You can do a pull request manually.
18+
- An annotation will be dumped, archived and pushed to the attached remote repository.
19+
You can do a pull request manually.

helm-chart/README.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
helm repo update
99
helm dependency update
1010
```
11-
4. (Optional) Install ingress of your choice (for example: https://github.com/kubernetes/ingress-nginx)
12-
5. (Optional) Create certificates for https (for example: https://github.com/jetstack/cert-manager/ )
11+
4. (Optional) Install ingress of your choice (for example: <https://github.com/kubernetes/ingress-nginx>)
12+
5. (Optional) Create certificates for https (for example: <https://github.com/jetstack/cert-manager/>)
1313
6. (Optional) Create values.override.yaml and override there parameters you want
1414
7. Change postgresql password as described below
1515
8. Add ingress to values.override.yaml(example also below)
@@ -43,7 +43,7 @@ postgresql:
4343
## How to describe ingress:
4444
Just set `ingress.enabled:` to `true`, then copy example, uncomment it and change values there
4545
## How to understand what diff will be inflicted by 'helm upgrade'?
46-
You can use https://github.com/databus23/helm-diff#install for that
46+
You can use <https://github.com/databus23/helm-diff#install> for that
4747
## I want to use my own postgresql/redis with your chart.
4848
Just set `postgresql.enabled` or `redis.enabled` to `false`, as described below.
4949
Then - put your instance params to "external" field
@@ -53,6 +53,6 @@ Then reference it in helm update/install command using `-f` flag
5353
## Why you used external charts to provide redis and postgres?
5454
Because they definitely know what they do better then we are, so we are getting more quality and less support
5555
## What is kubernetes and how it is working?
56-
See https://kubernetes.io/
56+
See <https://kubernetes.io/>
5757
## What is helm and how it is working?
58-
See https://helm.sh/
58+
See <https://helm.sh/>

0 commit comments

Comments
 (0)