blob: 4bafb5c29ec2e89c58b92098abb1f16730b874f4 [file] [log] [blame]
Robert Szewczyk38cf7312020-06-29 09:07:49 -07001#
2# Copyright (c) 2020 Project CHIP Authors
3#
4# Licensed under the Apache License, Version 2.0 (the "License");
5# you may not use this file except in compliance with the License.
6# You may obtain a copy of the License at
7#
8# http://www.apache.org/licenses/LICENSE-2.0
9#
10# Unless required by applicable law or agreed to in writing, software
11# distributed under the License is distributed on an "AS IS" BASIS,
12# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13# See the License for the specific language governing permissions and
14# limitations under the License.
15#
16
Justin Wood0c46b2e2020-04-17 14:20:48 -070017# Do anything at all
18enabled: true
19
20# Push the style fixes directly to the original PR
21auto: false
22
23# Open Restyle PRs?
24pull_requests: true
25
26# Add labels to any created Restyle PRs
27labels:
28 - restyled
29
30# Labels to ignore
31ignore_labels:
32 - restyled-ignore
33
34# Leave comments on the original PR linking to the Restyle PR?
35comments: false
36
37# Request review on the Restyle PR
38request_review: none
39
40# Patterns to exclude from all Restylers
41exclude:
42 - ".github/workflows/**/*" # https://github.com/restyled-io/restyler/issues/73
Vivien Nicolasdd625452020-07-09 04:56:45 +020043 - ".github/workflows/*" # https://github.com/restyled-io/restyler/issues/73
44 - ".github/**/*" # https://github.com/restyled-io/restyler/issues/73
45 - ".github/*" # https://github.com/restyled-io/restyler/issues/73
Boris Zbarsky775b2b12020-09-11 11:06:36 -040046 - "*/**/third_party/*" # https://github.com/restyled-io/restyled.io/issues/213
47 - "*/**/third_party/**" # https://github.com/restyled-io/restyled.io/issues/213
48 - "*/**/third_party/**/*" # https://github.com/restyled-io/restyled.io/issues/213
Rob Walker085b3d02020-09-08 14:11:59 -070049 - "third_party/android/**/*"
50 - "third_party/inipp/repo/**/*"
51 - "third_party/jlink/**/*"
52 - "third_party/lwip/repo/**/*"
53 - "third_party/nlbuild-autotools/repo/**/*"
54 - "third_party/nlbuild-autotools/repo/.**/*" # "**/*" doesn't include directories that start with "."
55 - "third_party/nlassert/repo/**/*" # from here down built with $ awk '/path =/ {print $3 "/**/*"}' .gitmodules
56 - "third_party/nlfaultinjection/repo/**/*"
57 - "third_party/nlio/repo/**/*"
58 - "third_party/nlunit-test/repo/**/*"
59 - "third_party/mbedtls/repo/**/*"
60 - "examples/common/QRCode/repo/**/*"
61 - "examples/common/m5stack-tft/repo/**/*"
62 - "third_party/pigweed/repo/**/*"
63 - "third_party/openthread/repo/**/*"
64 - "third_party/ot-br-posix/repo/**/*"
65 - "third_party/bluez/repo/**/*"
Rob Walker085b3d02020-09-08 14:11:59 -070066 - "third_party/cirque/repo/**/*"
szatmzf44fb762020-10-19 18:36:24 -040067 - "third_party/nanopb/repo/**/*"
Yufeng Wanga3347142022-09-29 15:22:36 -070068 - "examples/android/CHIPTool/gradlew" # gradle wrapper generated file
Austin Hsieh77a9f6a2021-09-28 16:30:16 -070069 - "third_party/android_deps/gradlew" # gradle wrapper generated file
Jerry Johnsbb608352021-12-06 11:01:02 -080070 - "src/controller/python/chip/clusters/Objects.py" # generated file, no point to restyle
71 - "src/controller/python/chip/clusters/CHIPClusters.py" # generated file, no point to restyle
Terence Hampson260307b2023-01-05 09:56:23 -050072 - "scripts/py_matter_idl/matter_idl/tests/outputs/**/*" # Matches generated output 1:1
Andrei Litvin89c6fb62023-01-17 21:29:11 -050073 - "scripts/tools/zap/tests/outputs/**/*" # Matches generated output 1:1
cpagravelbc5e79c2022-06-10 07:08:50 -070074 - "examples/chef/sample_app_util/test_files/*.yaml"
Austin Bozowski4a83d6f2022-06-06 15:13:07 -070075 - "examples/chef/zzz_generated/**/*"
andrei-menzopolea419ac2022-09-30 22:06:46 +030076 - "examples/platform/nxp/k32w/k32w0/scripts/demo_generated_certs/**/*"
Andrei Litvin8eb18652022-10-11 13:39:21 -040077 - "integrations/cloudbuild/*.yaml" # uglier long command line content
Andrei Litvin559c7d52022-10-21 13:38:11 -040078 - "scripts/run_codegen_targets.sh" # shellharden breaks for loops over command outputs
Boris Zbarsky35187602022-11-02 18:19:46 -040079 - "src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h" # Too big?
80 - "src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.mm" # Too big?
Andrei Litvin89c6fb62023-01-17 21:29:11 -050081 - "zzz_generated/**/*" # already clang-formatted by our zap tooling
Rob Walker085b3d02020-09-08 14:11:59 -070082
83
84changed_paths:
85 maximum: 100000
86 outcome: error
Justin Wood0c46b2e2020-04-17 14:20:48 -070087
88# Restylers to run, and how
89restylers:
Rob Walker5a9f46d2020-05-26 14:32:28 -070090 - name: whitespace
91 enabled: true
Rob Walker085b3d02020-09-08 14:11:59 -070092 image: restyled/restyler-whitespace:v0.1.0.1
Rob Walker5a9f46d2020-05-26 14:32:28 -070093 command:
94 - whitespace
95 arguments: []
96 include:
Rob Walker84781242020-06-03 18:15:33 -070097 - "**/Dockerfile"
Rob Walker085b3d02020-09-08 14:11:59 -070098 - ".**/Dockerfile"
Rob Walkerafdc90d2020-06-03 20:07:26 -070099 - "**/*.yml"
100 - "**/*.yaml"
Rob Walker085b3d02020-09-08 14:11:59 -0700101 - ".**/*.yml"
102 - ".**/*.yaml"
Rob Walker84781242020-06-03 18:15:33 -0700103 - "**/*.sh"
Rob Walker5a9f46d2020-05-26 14:32:28 -0700104 - "**/*.c"
105 - "**/*.cc"
106 - "**/*.cpp"
Boris Zbarsky27f9fb42022-09-08 20:54:12 -0400107 - "**/*.ipp"
Rob Walker5a9f46d2020-05-26 14:32:28 -0700108 - "**/*.cxx"
109 - "**/*.c++"
110 - "**/*.C"
111 - "**/*.cs"
112 - "**/*.h"
113 - "**/*.hh"
114 - "**/*.hpp"
115 - "**/*.hxx"
116 - "**/*.h++"
117 - "**/*.H"
118 - "**/*.java"
119 - "**/*.js"
Rob Walkerafdc90d2020-06-03 20:07:26 -0700120 - "**/*.json"
Rob Walker085b3d02020-09-08 14:11:59 -0700121 - ".**/*.js"
122 - ".**/*.json"
Rob Walker5a9f46d2020-05-26 14:32:28 -0700123 - "**/*.m"
124 - "**/*.mm"
randyrossic4964e32020-06-23 19:14:03 -0400125 - name: google-java-format
126 enabled: true
Austin Hsiehac2a2e62021-06-17 16:19:11 -0700127 # Update https://github.com/project-chip/connectedhomeip/blob/master/scripts/tools/zap/generate.py if this version changes.
randyrossic4964e32020-06-23 19:14:03 -0400128 image: restyled/restyler-google-java-format:v1.6
129 command:
130 - google-java-format
131 - "--replace"
132 arguments: []
133 include:
134 - "**/*.java"
135 interpreters: []
Justin Wood0c46b2e2020-04-17 14:20:48 -0700136 - name: clang-format
137 enabled: true
138 image: restyled/restyler-clang-format:v9.0.0
139 command:
140 - clang-format
141 - "-i"
142 arguments: []
143 include:
144 - "**/*.c"
145 - "**/*.cc"
146 - "**/*.cpp"
Boris Zbarsky27f9fb42022-09-08 20:54:12 -0400147 - "**/*.ipp"
Justin Wood0c46b2e2020-04-17 14:20:48 -0700148 - "**/*.cxx"
149 - "**/*.c++"
150 - "**/*.C"
151 - "**/*.cs"
152 - "**/*.h"
153 - "**/*.hh"
154 - "**/*.hpp"
155 - "**/*.hxx"
156 - "**/*.h++"
157 - "**/*.H"
Justin Wood0c46b2e2020-04-17 14:20:48 -0700158 - "**/*.js"
159 - "**/*.m"
Rob Walker5a9f46d2020-05-26 14:32:28 -0700160 - "**/*.mm"
Justin Wood0c46b2e2020-04-17 14:20:48 -0700161 interpreters: []
Michael Spang65dd6512020-08-18 12:07:01 -0400162 - name: gn
163 image: restyled/restyler-gn:v1
164 enabled: true
165 include:
166 - "**/*.gn"
167 - "**/*.gni"
Justin Wood0a9545e2020-04-20 18:15:21 -0700168 - name: prettier-json
169 image: restyled/restyler-prettier:v1.19.1-2
Justin Wood0c46b2e2020-04-17 14:20:48 -0700170 enabled: true
Justin Wood0a9545e2020-04-20 18:15:21 -0700171 command:
172 - prettier
173 - "--write"
174 arguments: []
Justin Wood0c46b2e2020-04-17 14:20:48 -0700175 include:
176 - "**/*.json"
Rob Walker085b3d02020-09-08 14:11:59 -0700177 - ".**/*.json"
Justin Wood0a9545e2020-04-20 18:15:21 -0700178 interpreters: []
Justin Wood0c46b2e2020-04-17 14:20:48 -0700179 - name: prettier-markdown
Justin Wood0a9545e2020-04-20 18:15:21 -0700180 image: restyled/restyler-prettier:v1.19.1-2
181 command:
182 - prettier
183 - "--write"
184 arguments: []
Justin Wood0c46b2e2020-04-17 14:20:48 -0700185 enabled: true
186 include:
187 - "**/*.md"
188 - "**/*.markdown"
189 - name: prettier-yaml
Justin Wood0a9545e2020-04-20 18:15:21 -0700190 image: restyled/restyler-prettier:v1.19.1-2
Justin Wood0c46b2e2020-04-17 14:20:48 -0700191 enabled: true
192 include:
193 - "**/*.yml"
194 - "**/*.yaml"
195 - name: shellharden
Justin Wood0a9545e2020-04-20 18:15:21 -0700196 image: restyled/restyler-shellharden:v4.1.1-2
Justin Wood0c46b2e2020-04-17 14:20:48 -0700197 enabled: true
198 include:
199 - "**/*.sh"
200 - "**/*.bash"
201 - name: shfmt
Justin Wood0a9545e2020-04-20 18:15:21 -0700202 image: restyled/restyler-shfmt:v3.0.1
Justin Wood0c46b2e2020-04-17 14:20:48 -0700203 enabled: true
Justin Wooda923ce72020-05-13 18:59:48 -0700204 command:
205 - shfmt
206 - "-w"
207 arguments:
208 - "-i"
209 - "4"
210 - "-ci"
211 interpreters:
212 - sh
213 - bash
Justin Wood0c46b2e2020-04-17 14:20:48 -0700214 include:
215 - "**/*.sh"
216 - "**/*.bash"
Song GUOf0315002021-08-12 23:31:58 +0800217 - name: autopep8
Arkadiusz Bokowyd5bfb4b2023-01-09 16:15:00 +0100218 image: 'restyled/restyler-autopep8:v2.0.0'
Song GUOf0315002021-08-12 23:31:58 +0800219 command:
220 - autopep8
221 - '--in-place'
222 arguments: []
223 include:
224 - '**/*.py'
225 interpreters:
226 - python
Arkadiusz Bokowyd5bfb4b2023-01-09 16:15:00 +0100227 - name: isort
228 image: 'restyled/restyler-isort:v5.11.2'
229 command:
230 - isort
231 arguments: []
232 include:
233 - '**/*.py'
234 interpreters:
235 - python