Skip to content

Commit c50b75d

Browse files
authored
pre-commit add yamllint (#36)
Add yamllint config file Lint YAML files
1 parent 5b519fd commit c50b75d

3 files changed

Lines changed: 36 additions & 1 deletion

File tree

.github/linters/.yaml-lint.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# Licensed to the Apache Software Foundation (ASF) under one
2+
# or more contributor license agreements. See the NOTICE file
3+
# distributed with this work for additional information
4+
# regarding copyright ownership. The ASF licenses this file
5+
# to you under the Apache License, Version 2.0 (the
6+
# "License"); you may not use this file except in compliance
7+
# with the License. You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing,
12+
# software distributed under the License is distributed on an
13+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+
# KIND, either express or implied. See the License for the
15+
# specific language governing permissions and limitations
16+
# under the License.
17+
18+
---
19+
# https://yamllint.readthedocs.io/en/stable/
20+
extends: default
21+
22+
rules:
23+
colons: disable
24+
document-start: disable
25+
line-length: disable
26+
truthy: false

.github/workflows/build-pelican.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ on:
44
# This prevents the workflow from running automatically on a new branch
55
# When creating a new site branch, please ensure that the push and checkout branches agree
66
# and that the action/pelican destination value is updated accordingly
7-
branches: [ 'main' ]
7+
branches: ['main']
88
paths:
99
- 'content/**'
1010
- 'pelicanconf.py'

.pre-commit-config.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,3 +35,12 @@ repos:
3535
- id: trailing-whitespace
3636
args: [--markdown-linebreak-ext=md]
3737
exclude: \.svg$
38+
- repo: https://github.com/adrienverge/yamllint
39+
rev: v1.37.1
40+
hooks:
41+
- id: yamllint
42+
name: run yamllint
43+
description: check YAML files with yamllint
44+
args: [--strict, -c=.github/linters/.yaml-lint.yml]
45+
types: [yaml]
46+
files: \.ya?ml$

0 commit comments

Comments
 (0)