Skip to content

Commit b30f6e9

Browse files
authored
Lint all files and fix the error in tensorflow-lite WASI-NN plugin. (#95)
Signed-off-by: YiYing He <[email protected]>
1 parent 6988189 commit b30f6e9

Some content is hidden

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

82 files changed

+1097
-1100
lines changed

.github/linters/.markdown-lint.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
###########################
2+
###########################
3+
## Markdown Linter rules ##
4+
###########################
5+
###########################
6+
7+
# Linter rules doc:
8+
# - https://github.com/DavidAnson/markdownlint
9+
#
10+
# Copied from: https://github.com/github/super-linter/blob/main/TEMPLATES/.markdown-lint.yml
11+
#
12+
# Note:
13+
# To comment out a single error:
14+
# <!-- markdownlint-disable -->
15+
# any violations you want
16+
# <!-- markdownlint-restore -->
17+
#
18+
19+
###############
20+
# Rules by id #
21+
###############
22+
MD004: false # Unordered list style
23+
MD007:
24+
indent: 2 # Unordered list indentation
25+
MD013:
26+
line_length: 999 # Line length 80 is far to short. We allow soft wrapped paragraphs and raw code outputs
27+
MD026:
28+
punctuation: ".,;:!。,;:" # List of not allowed
29+
MD029: false # Ordered list item prefix
30+
MD033: false # Allow inline HTML
31+
MD036: false # Emphasis used instead of a heading
32+
33+
#################
34+
# Rules by tags #
35+
#################
36+
blank_lines: false # Error on blank lines

.github/workflows/codeql-analysis.yml

Lines changed: 13 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
---
21
name: CodeQL Analysis
32

43
on:
@@ -22,19 +21,16 @@ jobs:
2221
actions: read
2322
contents: read
2423
security-events: write
25-
26-
strategy:
27-
fail-fast: false
28-
matrix:
29-
language: ['javascript']
30-
steps:
31-
- name: Checkout
32-
uses: actions/checkout@v3
33-
34-
- name: Initialize CodeQL
35-
uses: github/codeql-action/[email protected]
36-
with:
37-
languages: ${{ matrix.language }}
38-
39-
- name: Perform CodeQL Analysis
40-
uses: github/codeql-action/[email protected]
24+
strategy:
25+
fail-fast: false
26+
matrix:
27+
language: ['javascript']
28+
steps:
29+
- name: Checkout
30+
uses: actions/checkout@v3
31+
- name: Initialize CodeQL
32+
uses: github/codeql-action/[email protected]
33+
with:
34+
languages: ${{ matrix.language }}
35+
- name: Perform CodeQL Analysis
36+
uses: github/codeql-action/[email protected]

.github/workflows/lint.yml

Lines changed: 10 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -14,38 +14,18 @@ permissions:
1414
contents: read
1515

1616
jobs:
17-
lint:
18-
name: Lint
19-
timeout-minutes: 30
17+
lint-markdown:
18+
name: Lint markdown
2019
runs-on: ubuntu-latest
2120
steps:
22-
- name: Checkout
21+
- name: Checkout code
2322
uses: actions/checkout@v3
2423

25-
- name: Set up Node
26-
uses: actions/setup-node@v3
27-
with:
28-
node-version: 16.18.0
29-
cache: npm
30-
31-
- name: Cache NPM Dependencies
32-
id: cache-npm
33-
uses: actions/cache@v3
24+
- name: Lint markdown format
25+
uses: github/super-linter/slim@v5
3426
env:
35-
cache-name: cache-node-modules
36-
with:
37-
path: node_modules
38-
key: ${{ runner.os }}-node-${{ hashFiles('package-lock.json') }}
39-
40-
- name: Check Cache
41-
if: ${{ steps.cache-npm.outputs.cache-hit != 'true' }}
42-
run: npm ci
43-
44-
- name: Check immutable package-lock
45-
run: git diff --exit-code
46-
47-
- name: Lint
48-
run: npm run lint:ci
49-
50-
- name: Prettier Code
51-
run: npm run format:diff
27+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
28+
DEFAULT_BRANCH: main
29+
FILTER_REGEX_INCLUDE: .*docs/.*md$
30+
VALIDATE_ALL_CODEBASE: false
31+
VALIDATE_MARKDOWN: true

docs/contribute/community.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ Everyone is welcome to join the WasmEdge community.
1010

1111
If you have any questions, feel free to open a GitHub issue on a related project or to join the following channels:
1212

13-
- Mailing list: Send an email to [[email protected]](https://groups.google.com/g/wasmedge/)
14-
- Discord: Join the [WasmEdge Discord server](https://discord.gg/h4KDyB8XTt)!
15-
- Slack: Join the #WasmEdge channel on the [CNCF Slack](https://slack.cncf.io/)
16-
- Twitter: Follow @realwasmedge on [Twitter](https://twitter.com/realwasmedge)
13+
- Mailing list: Send an email to [[email protected]](https://groups.google.com/g/wasmedge/)
14+
- Discord: Join the [WasmEdge Discord server](https://discord.gg/h4KDyB8XTt)!
15+
- Slack: Join the #WasmEdge channel on the [CNCF Slack](https://slack.cncf.io/)
16+
- Twitter: Follow @realwasmedge on [Twitter](https://twitter.com/realwasmedge)
1717

1818
## Community Meeting
1919

docs/contribute/contribute.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,8 @@ Before opening any issue, please look up the existing [issues](https://github.co
6363

6464
When reporting issues, always include:
6565

66-
- Version of your system
67-
- Configuration files of WasmEdge
66+
- Version of your system
67+
- Configuration files of WasmEdge
6868

6969
Because the issues are open to the public, when submitting the log and configuration files, be sure to remove any sensitive information, e.g. user name, password, IP address, and company name. You can replace those parts with "REDACTED" or other strings like "\*\*\*\*". Be sure to include the steps to reproduce the problem if applicable. It can help us understand and fix your issue faster.
7070

docs/contribute/installer.md

Lines changed: 60 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -48,115 +48,115 @@ The real installer handles all stuff. It supports python2.7 (not tested on earli
4848

4949
### Help Msg
5050

51-
- Short Option: `-h`
52-
- Full Option: `--help`
53-
- Description: Show this help message and exit.
51+
- Short Option: `-h`
52+
- Full Option: `--help`
53+
- Description: Show this help message and exit.
5454

5555
### Verbose
5656

57-
- Short Option: `-D`
58-
- Full Option: `--debug`
59-
- Description: Enable verbosity debug
57+
- Short Option: `-D`
58+
- Full Option: `--debug`
59+
- Description: Enable verbosity debug
6060

6161
### Specify the version of WasmEdge to install
6262

63-
- Short Option: `-v VERSION`
64-
- Full Option: `--version VERSION`
65-
- Description: Install the given VERSION of WasmEdge
66-
- Available Value: VERSION `0.11.2` or other valid release versions.
67-
- Note - In the case of supplied an invalid or nonexistent version, the installer exists with an error.
63+
- Short Option: `-v VERSION`
64+
- Full Option: `--version VERSION`
65+
- Description: Install the given VERSION of WasmEdge
66+
- Available Value: VERSION `0.11.2` or other valid release versions.
67+
- Note - In the case of supplied an invalid or nonexistent version, the installer exists with an error.
6868

6969
### Installation path
7070

71-
- Short Option: `-p PATH`
72-
- Full Option: `--path PATH`
73-
- Description: Install WasmEdge into the given PATH. The default Path is `$HOME/.wasmedge`.
74-
- Note - In any path other than the ones starting with `/usr` are treated as non system paths in the internals of the installer. The consequences are different directory structures for both.
75-
- Note - If the path not exists, the folder will be created.
71+
- Short Option: `-p PATH`
72+
- Full Option: `--path PATH`
73+
- Description: Install WasmEdge into the given PATH. The default Path is `$HOME/.wasmedge`.
74+
- Note - In any path other than the ones starting with `/usr` are treated as non system paths in the internals of the installer. The consequences are different directory structures for both.
75+
- Note - If the path not exists, the folder will be created.
7676

7777
### Uninstallation
7878

7979
#### Run uninstaller before installing
8080

81-
- Short Option: `-r {yes,no}`
82-
- Full Option: `--remove-old {yes, no}`
83-
- Description: Run the uninstaller script before installing. Default `yes`.
81+
- Short Option: `-r {yes,no}`
82+
- Full Option: `--remove-old {yes, no}`
83+
- Description: Run the uninstaller script before installing. Default `yes`.
8484

8585
#### Use a specific version of the uninstaller
8686

87-
- Short Option: `-u UNINSTALL_SCRIPT_TAG`
88-
- Full Option: `--uninstall-script-tag UNINSTALL_SCRIPT_TAG`
89-
- Description: Use the given GitHub tag to uninstall the script
87+
- Short Option: `-u UNINSTALL_SCRIPT_TAG`
88+
- Full Option: `--uninstall-script-tag UNINSTALL_SCRIPT_TAG`
89+
- Description: Use the given GitHub tag to uninstall the script
9090

9191
### Install Extensions
9292

93-
- Short Option: `-e [EXTENSIONS [EXTENSIONS ...]]`
94-
- Full Option: `--extension [EXTENSIONS [EXTENSIONS ...]]`
95-
- Description: Install wasmedge-extension tools.
96-
- Available Value (case sensitive): Supported Extensions `'tensorflow', 'image', 'all'`.
93+
- Short Option: `-e [EXTENSIONS [EXTENSIONS ...]]`
94+
- Full Option: `--extension [EXTENSIONS [EXTENSIONS ...]]`
95+
- Description: Install wasmedge-extension tools.
96+
- Available Value (case sensitive): Supported Extensions `'tensorflow', 'image', 'all'`.
9797

9898
#### Tensorflow Extensions Library Version
9999

100-
- Full Option: `--tf-version TF_VERSION`
101-
- Description: Install the given VERSION of the library of the Tensorflow and Tensorflow lite extension. Only available when the `Extensions` is set to `all` or `tensorflow`.
102-
- Note - It's the same as the WasmEdge version if not specified.
100+
- Full Option: `--tf-version TF_VERSION`
101+
- Description: Install the given VERSION of the library of the Tensorflow and Tensorflow lite extension. Only available when the `Extensions` is set to `all` or `tensorflow`.
102+
- Note - It's the same as the WasmEdge version if not specified.
103103

104104
#### Tensorflow Extensions Dependencies Version
105105

106-
- Full Option: `--tf-deps-version TF_DEPS_VERSION`
107-
- Description: Install the given VERSION of the dependencies of the Tensorflow and Tensorflow lite extension. Only available when the `Extensions` is set to `all` or `tensorflow`.
108-
- Note - It's the same as the WasmEdge version if not specified.
106+
- Full Option: `--tf-deps-version TF_DEPS_VERSION`
107+
- Description: Install the given VERSION of the dependencies of the Tensorflow and Tensorflow lite extension. Only available when the `Extensions` is set to `all` or `tensorflow`.
108+
- Note - It's the same as the WasmEdge version if not specified.
109109

110110
#### Tensorflow Extensions Tools Version
111111

112-
- Full Option: `--tf-tools-version TF_TOOLS_VERSION`
113-
- Description: Install the given VERSION of the tools of the Tensorflow and Tensorflow lite extension. Only available when the `Extensions` is set to `all` or `tensorflow`.
114-
- Note - It's the same as the WasmEdge version if not specified.
112+
- Full Option: `--tf-tools-version TF_TOOLS_VERSION`
113+
- Description: Install the given VERSION of the tools of the Tensorflow and Tensorflow lite extension. Only available when the `Extensions` is set to `all` or `tensorflow`.
114+
- Note - It's the same as the WasmEdge version if not specified.
115115

116116
#### Image Extensions Version
117117

118-
- Full Option: `--image-version IMAGE_VERSION`
119-
- Description: Install the given VERSION of the Image extension. Only available when the `Extensions` is set to `all` or `image`.
120-
- Note - It's the same as the WasmEdge version if not specified.
118+
- Full Option: `--image-version IMAGE_VERSION`
119+
- Description: Install the given VERSION of the Image extension. Only available when the `Extensions` is set to `all` or `image`.
120+
- Note - It's the same as the WasmEdge version if not specified.
121121

122122
### Plugins
123123

124-
- Note - Currently `--plugins` is an experimental option.
124+
- Note - Currently `--plugins` is an experimental option.
125125

126-
- Full Option: `--plugins wasi_crypto:0.11.0`
126+
- Full Option: `--plugins wasi_crypto:0.11.0`
127127

128-
- Note - The format for this argument is `<plugin_name>:<version_number>`. `<version_number>` is not compulsory. For example `--plugins wasi_crypto` is a valid option.
129-
- Note - `<plugin_name>` is cases sensitive. Allowed values are stated [here](https://wasmedge.org/docs/contribute/plugin/intro) in the `Rust Crate` column. The logic is that the release name should be the same.
130-
- Note - It's the same as the WasmEdge version if not specified.
128+
- Note - The format for this argument is `<plugin_name>:<version_number>`. `<version_number>` is not compulsory. For example `--plugins wasi_crypto` is a valid option.
129+
- Note - `<plugin_name>` is cases sensitive. Allowed values are stated [here](https://wasmedge.org/docs/contribute/plugin/intro) in the `Rust Crate` column. The logic is that the release name should be the same.
130+
- Note - It's the same as the WasmEdge version if not specified.
131131

132132
### DIST
133133

134-
- Full Option: `--dist ubuntu20.04` or `--dist manylinux2014`
135-
- Note - the `ubuntu20.04` and `manylinux2014` values are case insensitive and only these two are currently supported.
136-
- Note - Specifying `--dist` value for `Darwin` has no effect.
137-
- Note - For `Linux` platform if the distribution matches exactly as `Ubuntu 20.04` which is checked using `lsb_release` and python's `platform.dist()` functionality then it is set to `ubuntu20.04` if not specified, else it is used without questioning. However different release packages for WasmEdge are available only after `0.11.1` release below which there is no effect of specifying this option.
134+
- Full Option: `--dist ubuntu20.04` or `--dist manylinux2014`
135+
- Note - the `ubuntu20.04` and `manylinux2014` values are case insensitive and only these two are currently supported.
136+
- Note - Specifying `--dist` value for `Darwin` has no effect.
137+
- Note - For `Linux` platform if the distribution matches exactly as `Ubuntu 20.04` which is checked using `lsb_release` and python's `platform.dist()` functionality then it is set to `ubuntu20.04` if not specified, else it is used without questioning. However different release packages for WasmEdge are available only after `0.11.1` release below which there is no effect of specifying this option.
138138

139139
### Platform and OS
140140

141-
- Full Option: `--platform PLATFORM` or `--os OS`
142-
- Description: Install the given `PLATFORM` or `OS` version of WasmEdge. This value should be case insensitive to make the maximum compatibility.
143-
- Available Value (case insensitive): "Linux", "Darwin", "Windows".
141+
- Full Option: `--platform PLATFORM` or `--os OS`
142+
- Description: Install the given `PLATFORM` or `OS` version of WasmEdge. This value should be case insensitive to make the maximum compatibility.
143+
- Available Value (case insensitive): "Linux", "Darwin", "Windows".
144144

145145
### Machine and Arch
146146

147-
- Full Option: `--machine MACHINE` or `--arch ARCH`
148-
- Description: Install the given `MACHINE` or `ARCH` version of WasmEdge.
149-
- Available Value: "x86_64", "aarch64".
147+
- Full Option: `--machine MACHINE` or `--arch ARCH`
148+
- Description: Install the given `MACHINE` or `ARCH` version of WasmEdge.
149+
- Available Value: "x86_64", "aarch64".
150150

151151
## Behavior
152152

153-
- If there exists an installation at `$HOME/.wasmedge` which is to be noted as the default installation path, it is removed with or without uninstaller's invocation.
154-
- WasmEdge installation appends all the files it installs to a file which is located in the installer directory named `env` with it's path as `$INSTALLATION_PATH/env`
153+
- If there exists an installation at `$HOME/.wasmedge` which is to be noted as the default installation path, it is removed with or without uninstaller's invocation.
154+
- WasmEdge installation appends all the files it installs to a file which is located in the installer directory named `env` with it's path as `$INSTALLATION_PATH/env`
155155

156156
### Shell and it's configuration
157157

158-
- Source string in shell configuration is given as `. $INSTALLATION_PATH/env` so that it exports the necessary environment variables for WasmEdge.
159-
- Shell configuration file is appended with source string if it cannot find the source string in that file.
160-
- Currently it detects only `Bash` and `zsh` shells.
161-
- If the above shells are found, then their respective configuration files `$HOME/.bashrc` and `$HOME/.zshrc` are updated along with `$HOME/.zprofile` and `$HOME/.bash_profile` in case of Linux.
162-
- In case of `Darwin`, only `$HOME/.zprofile` is updated with the source string.
158+
- Source string in shell configuration is given as `. $INSTALLATION_PATH/env` so that it exports the necessary environment variables for WasmEdge.
159+
- Shell configuration file is appended with source string if it cannot find the source string in that file.
160+
- Currently it detects only `Bash` and `zsh` shells.
161+
- If the above shells are found, then their respective configuration files `$HOME/.bashrc` and `$HOME/.zshrc` are updated along with `$HOME/.zprofile` and `$HOME/.bash_profile` in case of Linux.
162+
- In case of `Darwin`, only `$HOME/.zprofile` is updated with the source string.

docs/contribute/overview.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -9,25 +9,25 @@ Contribution is always welcome! The WebAssembly ecosystem is still in its early
99

1010
To help new contributors understand WasmEdge development workflow, this guide will include
1111

12-
- [Build WasmEdge and WasmEdge plug-in from source on different platforms](/category/build-wasmedge-from-source)
13-
- [WasmEdge Plug-in system introduction](/category/wasmedge-plugin-system)
14-
- [Test WasmEdge](test.md)
15-
- [WasmEdge Fuzzing](fuzzing.md)
16-
- [WasmEdge internal explanation](internal.md)
17-
- [WasmEdge installer system explanation](installer.md)
18-
- [contributing steps](contribute.md)
19-
- [WasmEdge release process](release.md)
20-
- [Join WasmEdge community](community.md)
12+
- [Build WasmEdge and WasmEdge plug-in from source on different platforms](/category/build-wasmedge-from-source)
13+
- [WasmEdge Plug-in system introduction](/category/wasmedge-plugin-system)
14+
- [Test WasmEdge](test.md)
15+
- [WasmEdge Fuzzing](fuzzing.md)
16+
- [WasmEdge internal explanation](internal.md)
17+
- [WasmEdge installer system explanation](installer.md)
18+
- [contributing steps](contribute.md)
19+
- [WasmEdge release process](release.md)
20+
- [Join WasmEdge community](community.md)
2121

2222
## Ideas for contributions
2323

2424
If you're looking for something to contribute, we have issues
2525

26-
- labeled with [`good first issue`](https://github.com/WasmEdge/WasmEdge/issues?q=is%3Aissue+is%3Aopen+label%3A%22good+first+issue%22), which are recommendations for developers to contribute to WasmEdge by working on some easy tasks. These tasks will help contributors to learn the WasmEdge development workflow.
26+
- labeled with [`good first issue`](https://github.com/WasmEdge/WasmEdge/issues?q=is%3Aissue+is%3Aopen+label%3A%22good+first+issue%22), which are recommendations for developers to contribute to WasmEdge by working on some easy tasks. These tasks will help contributors to learn the WasmEdge development workflow.
2727

28-
- labeled with [`help wanted`](https://github.com/WasmEdge/WasmEdge/issues?q=is%3Aissue+is%3Aopen+label%3A%22help+wanted%22), for which are we need suggestions and opinions from the community.
28+
- labeled with [`help wanted`](https://github.com/WasmEdge/WasmEdge/issues?q=is%3Aissue+is%3Aopen+label%3A%22help+wanted%22), for which are we need suggestions and opinions from the community.
2929

30-
- [Roadmap](https://github.com/WasmEdge/WasmEdge/blob/master/docs/ROADMAP.md) for every year, which elaborates the new features in the coming days. You're also welcome to pick one.
30+
- [Roadmap](https://github.com/WasmEdge/WasmEdge/blob/master/docs/ROADMAP.md) for every year, which elaborates the new features in the coming days. You're also welcome to pick one.
3131

3232
If you find something is missing, don't hesitate to create an issue and let us know. Again, WasmEdge is open in development.
3333

0 commit comments

Comments
 (0)