blob: f55a0e367d91bd620ac6400f315d9832ad57ac2c [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/**/*"
Rob Walker085b3d02020-09-08 14:11:59 -070058 - "third_party/mbedtls/repo/**/*"
59 - "examples/common/QRCode/repo/**/*"
60 - "examples/common/m5stack-tft/repo/**/*"
61 - "third_party/pigweed/repo/**/*"
62 - "third_party/openthread/repo/**/*"
63 - "third_party/ot-br-posix/repo/**/*"
64 - "third_party/bluez/repo/**/*"
Rob Walker085b3d02020-09-08 14:11:59 -070065 - "third_party/cirque/repo/**/*"
szatmzf44fb762020-10-19 18:36:24 -040066 - "third_party/nanopb/repo/**/*"
Yufeng Wanga3347142022-09-29 15:22:36 -070067 - "examples/android/CHIPTool/gradlew" # gradle wrapper generated file
Austin Hsieh77a9f6a2021-09-28 16:30:16 -070068 - "third_party/android_deps/gradlew" # gradle wrapper generated file
Jerry Johnsbb608352021-12-06 11:01:02 -080069 - "src/controller/python/chip/clusters/Objects.py" # generated file, no point to restyle
70 - "src/controller/python/chip/clusters/CHIPClusters.py" # generated file, no point to restyle
Terence Hampson260307b2023-01-05 09:56:23 -050071 - "scripts/py_matter_idl/matter_idl/tests/outputs/**/*" # Matches generated output 1:1
Andrei Litvin89c6fb62023-01-17 21:29:11 -050072 - "scripts/tools/zap/tests/outputs/**/*" # Matches generated output 1:1
cpagravelbc5e79c2022-06-10 07:08:50 -070073 - "examples/chef/sample_app_util/test_files/*.yaml"
Austin Bozowski4a83d6f2022-06-06 15:13:07 -070074 - "examples/chef/zzz_generated/**/*"
andrei-menzopolea419ac2022-09-30 22:06:46 +030075 - "examples/platform/nxp/k32w/k32w0/scripts/demo_generated_certs/**/*"
Philip Gregor60edbf52024-03-25 12:16:22 -070076 - "examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/zap-generated/*" # zap-generated files
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
Justin Wood9ff82542023-10-23 22:43:09 -070079 - "scripts/tagging/tag_new_release.sh" # shellharden breaks parameter passing
Boris Zbarsky43dd3272023-01-23 01:49:42 -050080 - "src/darwin/Framework/CHIP/zap-generated/*" # already clang-formatted by our zap tooling
Andrei Litvin89c6fb62023-01-17 21:29:11 -050081 - "zzz_generated/**/*" # already clang-formatted by our zap tooling
Andrei Litvin31e31cc2023-03-22 09:23:10 -040082 - "src/controller/java/generated/java/**/*" # not formatted: generated files
Andrei Litvin2205eb62023-05-30 11:13:48 -040083 - "src/controller/java/zap-generated/**/*" # not formatted: generated files
Andrei Litvin509a55c2023-06-21 19:13:31 -040084 - "scripts/setup/bootstrap.sh" # tries to quote loop variable
Justin Wood3c75ed02023-07-18 19:00:42 -070085 - "integrations/docker/build-all.sh" # tries to quote loop variable
Terence Hampson1691e9c2023-10-17 11:01:00 -040086 - "scripts/setup/pigweed.json" # TODO(#29547). This file is temporary copy from pigweed repo that has minor edits. No restyle help in diff.
Andrei Litvine6909962023-11-29 16:13:19 -050087 - "docs/ERROR_CODES.md" # generated by scripts, not easy to align tables
C Freeman824ba6d2024-04-02 18:11:51 -040088 - "docs/zap_clusters.md" # generated by scripts, not easy to align tables
89 - "docs/spec_clusters.md" # generated by scripts, not easy to align tables
C Freeman8830ec12024-01-24 03:50:03 -050090 - "docs/testing/yaml_pseudocluster.md" # generated by scripts, restyler makes the tables render improperly
91 - "docs/testing/yaml_schema.md" # generated by scripts, restyler makes the tables render improperly
Rob Walker085b3d02020-09-08 14:11:59 -070092
93changed_paths:
Justin Wood3c75ed02023-07-18 19:00:42 -070094 maximum: 100000
95 outcome: error
Justin Wood0c46b2e2020-04-17 14:20:48 -070096
97# Restylers to run, and how
98restylers:
Rob Walker5a9f46d2020-05-26 14:32:28 -070099 - name: whitespace
100 enabled: true
Rob Walker085b3d02020-09-08 14:11:59 -0700101 image: restyled/restyler-whitespace:v0.1.0.1
Rob Walker5a9f46d2020-05-26 14:32:28 -0700102 command:
103 - whitespace
104 arguments: []
105 include:
Rob Walker84781242020-06-03 18:15:33 -0700106 - "**/Dockerfile"
Rob Walker085b3d02020-09-08 14:11:59 -0700107 - ".**/Dockerfile"
Rob Walkerafdc90d2020-06-03 20:07:26 -0700108 - "**/*.yml"
109 - "**/*.yaml"
Rob Walker085b3d02020-09-08 14:11:59 -0700110 - ".**/*.yml"
111 - ".**/*.yaml"
Rob Walker84781242020-06-03 18:15:33 -0700112 - "**/*.sh"
Rob Walker5a9f46d2020-05-26 14:32:28 -0700113 - "**/*.c"
114 - "**/*.cc"
115 - "**/*.cpp"
Boris Zbarsky27f9fb42022-09-08 20:54:12 -0400116 - "**/*.ipp"
Rob Walker5a9f46d2020-05-26 14:32:28 -0700117 - "**/*.cxx"
118 - "**/*.c++"
119 - "**/*.C"
120 - "**/*.cs"
121 - "**/*.h"
122 - "**/*.hh"
123 - "**/*.hpp"
124 - "**/*.hxx"
125 - "**/*.h++"
126 - "**/*.H"
127 - "**/*.java"
128 - "**/*.js"
Rob Walkerafdc90d2020-06-03 20:07:26 -0700129 - "**/*.json"
Rob Walker085b3d02020-09-08 14:11:59 -0700130 - ".**/*.js"
131 - ".**/*.json"
Rob Walker5a9f46d2020-05-26 14:32:28 -0700132 - "**/*.m"
133 - "**/*.mm"
randyrossic4964e32020-06-23 19:14:03 -0400134 - name: google-java-format
135 enabled: true
Austin Hsiehac2a2e62021-06-17 16:19:11 -0700136 # Update https://github.com/project-chip/connectedhomeip/blob/master/scripts/tools/zap/generate.py if this version changes.
randyrossic4964e32020-06-23 19:14:03 -0400137 image: restyled/restyler-google-java-format:v1.6
138 command:
139 - google-java-format
140 - "--replace"
141 arguments: []
142 include:
143 - "**/*.java"
144 interpreters: []
Justin Wood0c46b2e2020-04-17 14:20:48 -0700145 - name: clang-format
146 enabled: true
Karsten Sperlingf299acb2023-09-27 15:39:32 +1300147 image: restyled/restyler-clang-format:v16.0.6
Justin Wood0c46b2e2020-04-17 14:20:48 -0700148 command:
149 - clang-format
150 - "-i"
151 arguments: []
152 include:
153 - "**/*.c"
154 - "**/*.cc"
155 - "**/*.cpp"
Boris Zbarsky27f9fb42022-09-08 20:54:12 -0400156 - "**/*.ipp"
Justin Wood0c46b2e2020-04-17 14:20:48 -0700157 - "**/*.cxx"
158 - "**/*.c++"
159 - "**/*.C"
160 - "**/*.cs"
161 - "**/*.h"
162 - "**/*.hh"
163 - "**/*.hpp"
164 - "**/*.hxx"
165 - "**/*.h++"
166 - "**/*.H"
Justin Wood0c46b2e2020-04-17 14:20:48 -0700167 - "**/*.js"
168 - "**/*.m"
Rob Walker5a9f46d2020-05-26 14:32:28 -0700169 - "**/*.mm"
Justin Wood0c46b2e2020-04-17 14:20:48 -0700170 interpreters: []
Michael Spang65dd6512020-08-18 12:07:01 -0400171 - name: gn
172 image: restyled/restyler-gn:v1
173 enabled: true
174 include:
175 - "**/*.gn"
176 - "**/*.gni"
Justin Wood0a9545e2020-04-20 18:15:21 -0700177 - name: prettier-json
178 image: restyled/restyler-prettier:v1.19.1-2
Justin Wood0c46b2e2020-04-17 14:20:48 -0700179 enabled: true
Justin Wood0a9545e2020-04-20 18:15:21 -0700180 command:
181 - prettier
182 - "--write"
183 arguments: []
Justin Wood0c46b2e2020-04-17 14:20:48 -0700184 include:
185 - "**/*.json"
Rob Walker085b3d02020-09-08 14:11:59 -0700186 - ".**/*.json"
Justin Wood0a9545e2020-04-20 18:15:21 -0700187 interpreters: []
Justin Wood0c46b2e2020-04-17 14:20:48 -0700188 - name: prettier-markdown
Justin Wood0a9545e2020-04-20 18:15:21 -0700189 image: restyled/restyler-prettier:v1.19.1-2
190 command:
191 - prettier
192 - "--write"
193 arguments: []
Justin Wood0c46b2e2020-04-17 14:20:48 -0700194 enabled: true
195 include:
196 - "**/*.md"
197 - "**/*.markdown"
198 - name: prettier-yaml
Justin Wood0a9545e2020-04-20 18:15:21 -0700199 image: restyled/restyler-prettier:v1.19.1-2
Justin Wood0c46b2e2020-04-17 14:20:48 -0700200 enabled: true
Boris Zbarskyf9eb6ce2023-06-15 17:48:26 -0400201 command:
202 - prettier
203 - "--write"
Justin Wood0c46b2e2020-04-17 14:20:48 -0700204 include:
205 - "**/*.yml"
206 - "**/*.yaml"
207 - name: shellharden
Justin Wood0a9545e2020-04-20 18:15:21 -0700208 image: restyled/restyler-shellharden:v4.1.1-2
Justin Wood0c46b2e2020-04-17 14:20:48 -0700209 enabled: true
210 include:
211 - "**/*.sh"
212 - "**/*.bash"
213 - name: shfmt
Justin Wood0a9545e2020-04-20 18:15:21 -0700214 image: restyled/restyler-shfmt:v3.0.1
Justin Wood0c46b2e2020-04-17 14:20:48 -0700215 enabled: true
Justin Wooda923ce72020-05-13 18:59:48 -0700216 command:
217 - shfmt
218 - "-w"
219 arguments:
220 - "-i"
221 - "4"
222 - "-ci"
223 interpreters:
224 - sh
225 - bash
Justin Wood0c46b2e2020-04-17 14:20:48 -0700226 include:
227 - "**/*.sh"
228 - "**/*.bash"
Song GUOf0315002021-08-12 23:31:58 +0800229 - name: autopep8
Justin Wood3c75ed02023-07-18 19:00:42 -0700230 image: restyled/restyler-autopep8:v2.0.0
Song GUOf0315002021-08-12 23:31:58 +0800231 command:
Justin Wood3c75ed02023-07-18 19:00:42 -0700232 - autopep8
233 - "--in-place"
Stefan Agner3b1c8252024-03-15 18:25:55 +0100234 - "--max-line-length"
235 - "132"
Song GUOf0315002021-08-12 23:31:58 +0800236 arguments: []
237 include:
Justin Wood3c75ed02023-07-18 19:00:42 -0700238 - "**/*.py"
Song GUOf0315002021-08-12 23:31:58 +0800239 interpreters:
Justin Wood3c75ed02023-07-18 19:00:42 -0700240 - python
Arkadiusz Bokowyd5bfb4b2023-01-09 16:15:00 +0100241 - name: isort
Justin Wood3c75ed02023-07-18 19:00:42 -0700242 image: restyled/restyler-isort:v5.11.2
Arkadiusz Bokowyd5bfb4b2023-01-09 16:15:00 +0100243 command:
Justin Wood3c75ed02023-07-18 19:00:42 -0700244 - isort
Arkadiusz Bokowyd5bfb4b2023-01-09 16:15:00 +0100245 arguments: []
246 include:
Justin Wood3c75ed02023-07-18 19:00:42 -0700247 - "**/*.py"
Arkadiusz Bokowyd5bfb4b2023-01-09 16:15:00 +0100248 interpreters:
Justin Wood3c75ed02023-07-18 19:00:42 -0700249 - python