Skip to content

Commit 96c593a

Browse files
Merge #482
482: Add yaml linting check in CI r=bidoubiwa a=meili-bot _This PR is auto-generated._ To avoid mistakes in the `yaml` files, for example, duplicated keys or wrong indentation, we decided to add a lint check on `yaml` files. Additional to the `.yamllint` files added in this pr, the following must be added as well: - Linting check in CI: Example in `tests.yml create a new job: ```yaml lint: name: Linting check runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - name: Yaml lint check uses: ibiqlik/action-yamllint@v3 with: config_file: .yamllint.yml ``` - Inside `.yamllint`, you might want to ignore some folders. For example `node_modules` in JS repos Example in `.yamllint`: ```yaml ignore: | node_modules ```` Since `yamllint` is a python package, we cannot add a local check unless you download [`.yamllint`](https://github.com/adrienverge/yamllint). In which case, you can check if the yaml files are correctly linted by running the following command: `yamllint .` Additionally, you can use the VSCode extension [`YAML` by redhat](https://marketplace.visualstudio.com/items?itemName=redhat.vscode-yaml) which automatically highlights errors. To help users be aware of this, we recommend adding this to your contributing guide: ``` To check if your `yaml` files are correctly formatted, you need to [install yamllint](https://yamllint.readthedocs.io/en/stable/quickstart.html#installing-yamllint) and then run `yamllint .` ```` ## TODO - [ ] Add the directories or files to ignore in `.yamllint` - [ ] Add information in the contributing guide on this new check. Co-authored-by: meili-bot <74670311+meili-bot@users.noreply.github.com>
2 parents 039ad9d + a60be26 commit 96c593a

File tree

5 files changed

+43
-21
lines changed

5 files changed

+43
-21
lines changed

.code-samples.meilisearch.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -898,7 +898,7 @@ typo_tolerance_guide_3: |-
898898
disable_on_words: Some(vec!["shrek".to_string()]),
899899
min_word_size_for_typos: Some(min_word_size_for_typos),
900900
};
901-
901+
902902
let task: TaskInfo = client
903903
.index("movies")
904904
.set_typo_tolerance(&typo_tolerance)
@@ -1337,7 +1337,7 @@ faceted_search_2: |-
13371337
.build();
13381338
let search_query_3 = SearchQuery::new(&books)
13391339
.with_facets(Selectors::Some(&["genres"]))
1340-
.with_filter("language = English OR language = French")
1340+
.with_filter("language = English OR language = French")
13411341
.build();
13421342
13431343
let books_response = client
@@ -1634,7 +1634,7 @@ multi_search_1: |-
16341634
.build();
16351635
let search_query_2 = SearchQuery::new(&movie)
16361636
.with_query("nemo")
1637-
.with_limit(5)
1637+
.with_limit(5)
16381638
.build();
16391639
16401640
let movie_response = client

.github/dependabot.yml

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
11
version: 2
22
updates:
3-
- package-ecosystem: "github-actions"
4-
directory: "/"
5-
schedule:
6-
interval: "monthly"
7-
labels:
8-
- 'skip-changelog'
9-
- 'dependencies'
10-
rebase-strategy: disabled
3+
- package-ecosystem: "github-actions"
4+
directory: "/"
5+
schedule:
6+
interval: "monthly"
7+
labels:
8+
- 'skip-changelog'
9+
- 'dependencies'
10+
rebase-strategy: disabled
1111

12-
- package-ecosystem: cargo
13-
directory: "/"
14-
schedule:
15-
interval: daily
16-
time: "04:00"
17-
open-pull-requests-limit: 10
18-
labels:
19-
- skip-changelog
20-
- dependencies
21-
rebase-strategy: disabled
12+
- package-ecosystem: cargo
13+
directory: "/"
14+
schedule:
15+
interval: daily
16+
time: "04:00"
17+
open-pull-requests-limit: 10
18+
labels:
19+
- skip-changelog
20+
- dependencies
21+
rebase-strategy: disabled

.github/workflows/tests.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,3 +69,12 @@ jobs:
6969
run: |
7070
rustup target add wasm32-unknown-unknown
7171
cargo check -p web_app --target wasm32-unknown-unknown
72+
yaml-lint:
73+
name: Yaml linting check
74+
runs-on: ubuntu-latest
75+
steps:
76+
- uses: actions/checkout@v3
77+
- name: Yaml lint check
78+
uses: ibiqlik/action-yamllint@v3
79+
with:
80+
config_file: .yamllint.yml

.yamllint.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
extends: default
2+
ignore: |
3+
node_modules
4+
rules:
5+
comments-indentation: disable
6+
line-length: disable
7+
document-start: disable
8+
brackets: disable
9+
truthy: disable

CONTRIBUTING.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,10 @@ sh scripts/check-readme.sh --diff
124124

125125
If it's not, the CI will fail on your PR.
126126

127+
### Yaml lint
128+
129+
To check if your `yaml` files are correctly formatted, you need to [install yamllint](https://yamllint.readthedocs.io/en/stable/quickstart.html#installing-yamllint) and then run `yamllint .`
130+
127131
## Git Guidelines
128132

129133
### Git Branches <!-- omit in toc -->

0 commit comments

Comments
 (0)