blob: 1351fbdfa33c0f51a2b52d696ee1c9bcc358e99f [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 Zbarsky43dd3272023-01-23 01:49:42 -050079 - "src/darwin/Framework/CHIP/zap-generated/*" # already clang-formatted by our zap tooling
Andrei Litvin89c6fb62023-01-17 21:29:11 -050080 - "zzz_generated/**/*" # already clang-formatted by our zap tooling
Andrei Litvin31e31cc2023-03-22 09:23:10 -040081 - "src/controller/java/generated/java/**/*" # not formatted: generated files
Andrei Litvin2205eb62023-05-30 11:13:48 -040082 - "src/controller/java/zap-generated/**/*" # not formatted: generated files
Andrei Litvin509a55c2023-06-21 19:13:31 -040083 - "scripts/setup/bootstrap.sh" # tries to quote loop variable
Justin Wood3c75ed02023-07-18 19:00:42 -070084 - "integrations/docker/build-all.sh" # tries to quote loop variable
Rob Walker085b3d02020-09-08 14:11:59 -070085
86changed_paths:
Justin Wood3c75ed02023-07-18 19:00:42 -070087 maximum: 100000
88 outcome: error
Justin Wood0c46b2e2020-04-17 14:20:48 -070089
90# Restylers to run, and how
91restylers:
Rob Walker5a9f46d2020-05-26 14:32:28 -070092 - name: whitespace
93 enabled: true
Rob Walker085b3d02020-09-08 14:11:59 -070094 image: restyled/restyler-whitespace:v0.1.0.1
Rob Walker5a9f46d2020-05-26 14:32:28 -070095 command:
96 - whitespace
97 arguments: []
98 include:
Rob Walker84781242020-06-03 18:15:33 -070099 - "**/Dockerfile"
Rob Walker085b3d02020-09-08 14:11:59 -0700100 - ".**/Dockerfile"
Rob Walkerafdc90d2020-06-03 20:07:26 -0700101 - "**/*.yml"
102 - "**/*.yaml"
Rob Walker085b3d02020-09-08 14:11:59 -0700103 - ".**/*.yml"
104 - ".**/*.yaml"
Rob Walker84781242020-06-03 18:15:33 -0700105 - "**/*.sh"
Rob Walker5a9f46d2020-05-26 14:32:28 -0700106 - "**/*.c"
107 - "**/*.cc"
108 - "**/*.cpp"
Boris Zbarsky27f9fb42022-09-08 20:54:12 -0400109 - "**/*.ipp"
Rob Walker5a9f46d2020-05-26 14:32:28 -0700110 - "**/*.cxx"
111 - "**/*.c++"
112 - "**/*.C"
113 - "**/*.cs"
114 - "**/*.h"
115 - "**/*.hh"
116 - "**/*.hpp"
117 - "**/*.hxx"
118 - "**/*.h++"
119 - "**/*.H"
120 - "**/*.java"
121 - "**/*.js"
Rob Walkerafdc90d2020-06-03 20:07:26 -0700122 - "**/*.json"
Rob Walker085b3d02020-09-08 14:11:59 -0700123 - ".**/*.js"
124 - ".**/*.json"
Rob Walker5a9f46d2020-05-26 14:32:28 -0700125 - "**/*.m"
126 - "**/*.mm"
randyrossic4964e32020-06-23 19:14:03 -0400127 - name: google-java-format
128 enabled: true
Austin Hsiehac2a2e62021-06-17 16:19:11 -0700129 # Update https://github.com/project-chip/connectedhomeip/blob/master/scripts/tools/zap/generate.py if this version changes.
randyrossic4964e32020-06-23 19:14:03 -0400130 image: restyled/restyler-google-java-format:v1.6
131 command:
132 - google-java-format
133 - "--replace"
134 arguments: []
135 include:
136 - "**/*.java"
137 interpreters: []
Justin Wood0c46b2e2020-04-17 14:20:48 -0700138 - name: clang-format
139 enabled: true
140 image: restyled/restyler-clang-format:v9.0.0
141 command:
142 - clang-format
143 - "-i"
144 arguments: []
145 include:
146 - "**/*.c"
147 - "**/*.cc"
148 - "**/*.cpp"
Boris Zbarsky27f9fb42022-09-08 20:54:12 -0400149 - "**/*.ipp"
Justin Wood0c46b2e2020-04-17 14:20:48 -0700150 - "**/*.cxx"
151 - "**/*.c++"
152 - "**/*.C"
153 - "**/*.cs"
154 - "**/*.h"
155 - "**/*.hh"
156 - "**/*.hpp"
157 - "**/*.hxx"
158 - "**/*.h++"
159 - "**/*.H"
Justin Wood0c46b2e2020-04-17 14:20:48 -0700160 - "**/*.js"
161 - "**/*.m"
Rob Walker5a9f46d2020-05-26 14:32:28 -0700162 - "**/*.mm"
Justin Wood0c46b2e2020-04-17 14:20:48 -0700163 interpreters: []
Michael Spang65dd6512020-08-18 12:07:01 -0400164 - name: gn
165 image: restyled/restyler-gn:v1
166 enabled: true
167 include:
168 - "**/*.gn"
169 - "**/*.gni"
Justin Wood0a9545e2020-04-20 18:15:21 -0700170 - name: prettier-json
171 image: restyled/restyler-prettier:v1.19.1-2
Justin Wood0c46b2e2020-04-17 14:20:48 -0700172 enabled: true
Justin Wood0a9545e2020-04-20 18:15:21 -0700173 command:
174 - prettier
175 - "--write"
176 arguments: []
Justin Wood0c46b2e2020-04-17 14:20:48 -0700177 include:
178 - "**/*.json"
Rob Walker085b3d02020-09-08 14:11:59 -0700179 - ".**/*.json"
Justin Wood0a9545e2020-04-20 18:15:21 -0700180 interpreters: []
Justin Wood0c46b2e2020-04-17 14:20:48 -0700181 - name: prettier-markdown
Justin Wood0a9545e2020-04-20 18:15:21 -0700182 image: restyled/restyler-prettier:v1.19.1-2
183 command:
184 - prettier
185 - "--write"
186 arguments: []
Justin Wood0c46b2e2020-04-17 14:20:48 -0700187 enabled: true
188 include:
189 - "**/*.md"
190 - "**/*.markdown"
191 - name: prettier-yaml
Justin Wood0a9545e2020-04-20 18:15:21 -0700192 image: restyled/restyler-prettier:v1.19.1-2
Justin Wood0c46b2e2020-04-17 14:20:48 -0700193 enabled: true
Boris Zbarskyf9eb6ce2023-06-15 17:48:26 -0400194 command:
195 - prettier
196 - "--write"
Justin Wood0c46b2e2020-04-17 14:20:48 -0700197 include:
198 - "**/*.yml"
199 - "**/*.yaml"
200 - name: shellharden
Justin Wood0a9545e2020-04-20 18:15:21 -0700201 image: restyled/restyler-shellharden:v4.1.1-2
Justin Wood0c46b2e2020-04-17 14:20:48 -0700202 enabled: true
203 include:
204 - "**/*.sh"
205 - "**/*.bash"
206 - name: shfmt
Justin Wood0a9545e2020-04-20 18:15:21 -0700207 image: restyled/restyler-shfmt:v3.0.1
Justin Wood0c46b2e2020-04-17 14:20:48 -0700208 enabled: true
Justin Wooda923ce72020-05-13 18:59:48 -0700209 command:
210 - shfmt
211 - "-w"
212 arguments:
213 - "-i"
214 - "4"
215 - "-ci"
216 interpreters:
217 - sh
218 - bash
Justin Wood0c46b2e2020-04-17 14:20:48 -0700219 include:
220 - "**/*.sh"
221 - "**/*.bash"
Song GUOf0315002021-08-12 23:31:58 +0800222 - name: autopep8
Justin Wood3c75ed02023-07-18 19:00:42 -0700223 image: restyled/restyler-autopep8:v2.0.0
Song GUOf0315002021-08-12 23:31:58 +0800224 command:
Justin Wood3c75ed02023-07-18 19:00:42 -0700225 - autopep8
226 - "--in-place"
Song GUOf0315002021-08-12 23:31:58 +0800227 arguments: []
228 include:
Justin Wood3c75ed02023-07-18 19:00:42 -0700229 - "**/*.py"
Song GUOf0315002021-08-12 23:31:58 +0800230 interpreters:
Justin Wood3c75ed02023-07-18 19:00:42 -0700231 - python
Arkadiusz Bokowyd5bfb4b2023-01-09 16:15:00 +0100232 - name: isort
Justin Wood3c75ed02023-07-18 19:00:42 -0700233 image: restyled/restyler-isort:v5.11.2
Arkadiusz Bokowyd5bfb4b2023-01-09 16:15:00 +0100234 command:
Justin Wood3c75ed02023-07-18 19:00:42 -0700235 - isort
Arkadiusz Bokowyd5bfb4b2023-01-09 16:15:00 +0100236 arguments: []
237 include:
Justin Wood3c75ed02023-07-18 19:00:42 -0700238 - "**/*.py"
Arkadiusz Bokowyd5bfb4b2023-01-09 16:15:00 +0100239 interpreters:
Justin Wood3c75ed02023-07-18 19:00:42 -0700240 - python