codeveto 0.1.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (106) hide show
  1. codeveto/__init__.py +3 -0
  2. codeveto/__main__.py +8 -0
  3. codeveto/ai/__init__.py +19 -0
  4. codeveto/ai/harness.py +303 -0
  5. codeveto/ai/packets.py +855 -0
  6. codeveto/ai/policy.py +222 -0
  7. codeveto/ai/prompt.py +101 -0
  8. codeveto/ai/providers/__init__.py +178 -0
  9. codeveto/ai/providers/claude.py +247 -0
  10. codeveto/ai/providers/openai_compat.py +246 -0
  11. codeveto/ai/runner.py +293 -0
  12. codeveto/ai/verify.py +324 -0
  13. codeveto/anchor.py +211 -0
  14. codeveto/cli.py +247 -0
  15. codeveto/cli_explain.py +49 -0
  16. codeveto/cli_hook.py +31 -0
  17. codeveto/cli_init.py +254 -0
  18. codeveto/cli_mcp.py +29 -0
  19. codeveto/cli_packets.py +35 -0
  20. codeveto/cli_publish.py +29 -0
  21. codeveto/cli_review.py +362 -0
  22. codeveto/cli_rules.py +78 -0
  23. codeveto/cli_verify.py +47 -0
  24. codeveto/config.py +1229 -0
  25. codeveto/data/README.md +16 -0
  26. codeveto/data/ai-wire.schema.json +53 -0
  27. codeveto/data/prompts/system.md +57 -0
  28. codeveto/data/report-v1.schema.json +268 -0
  29. codeveto/data/templates/forgejo-codeveto.yml +104 -0
  30. codeveto/data/templates/github-codeveto.yml +18 -0
  31. codeveto/embedded.py +311 -0
  32. codeveto/engine.py +1570 -0
  33. codeveto/git.py +1549 -0
  34. codeveto/globs.py +348 -0
  35. codeveto/integrations/__init__.py +1 -0
  36. codeveto/integrations/hooks.py +327 -0
  37. codeveto/integrations/mcp.py +770 -0
  38. codeveto/integrations/mcp_ai.py +77 -0
  39. codeveto/integrations/prepush.py +222 -0
  40. codeveto/jsonsafe.py +60 -0
  41. codeveto/languages.py +539 -0
  42. codeveto/lexers.py +2560 -0
  43. codeveto/model.py +372 -0
  44. codeveto/publish/__init__.py +28 -0
  45. codeveto/publish/action.py +330 -0
  46. codeveto/publish/common.py +84 -0
  47. codeveto/publish/diff.py +208 -0
  48. codeveto/publish/event.py +241 -0
  49. codeveto/publish/forgejo.py +184 -0
  50. codeveto/publish/github.py +380 -0
  51. codeveto/publish/http.py +263 -0
  52. codeveto/publish/pull.py +218 -0
  53. codeveto/publish/untrusted.py +110 -0
  54. codeveto/py.typed +0 -0
  55. codeveto/redact.py +113 -0
  56. codeveto/render/__init__.py +64 -0
  57. codeveto/render/agent.py +43 -0
  58. codeveto/render/github.py +101 -0
  59. codeveto/render/json.py +23 -0
  60. codeveto/render/markdown.py +208 -0
  61. codeveto/render/safe.py +249 -0
  62. codeveto/render/sarif.py +217 -0
  63. codeveto/render/text.py +210 -0
  64. codeveto/report.py +252 -0
  65. codeveto/rules/__init__.py +84 -0
  66. codeveto/rules/agent.py +2972 -0
  67. codeveto/rules/base.py +1026 -0
  68. codeveto/rules/ci.py +1708 -0
  69. codeveto/rules/config.py +493 -0
  70. codeveto/rules/deps.py +1693 -0
  71. codeveto/rules/docker.py +479 -0
  72. codeveto/rules/examples/__init__.py +148 -0
  73. codeveto/rules/examples/agent.py +839 -0
  74. codeveto/rules/examples/ci.py +1046 -0
  75. codeveto/rules/examples/config.py +191 -0
  76. codeveto/rules/examples/deps.py +369 -0
  77. codeveto/rules/examples/docker.py +157 -0
  78. codeveto/rules/examples/go.py +241 -0
  79. codeveto/rules/examples/hygiene.py +466 -0
  80. codeveto/rules/examples/js.py +462 -0
  81. codeveto/rules/examples/python.py +595 -0
  82. codeveto/rules/examples/rust.py +268 -0
  83. codeveto/rules/examples/secrets.py +561 -0
  84. codeveto/rules/examples/security.py +608 -0
  85. codeveto/rules/examples/shell.py +174 -0
  86. codeveto/rules/examples/sql.py +194 -0
  87. codeveto/rules/examples/tests.py +497 -0
  88. codeveto/rules/go.py +328 -0
  89. codeveto/rules/hygiene.py +1094 -0
  90. codeveto/rules/js.py +768 -0
  91. codeveto/rules/python.py +1642 -0
  92. codeveto/rules/rust.py +209 -0
  93. codeveto/rules/secrets.py +1335 -0
  94. codeveto/rules/security.py +3680 -0
  95. codeveto/rules/shell.py +867 -0
  96. codeveto/rules/sql.py +629 -0
  97. codeveto/rules/tests.py +1404 -0
  98. codeveto/schema.py +384 -0
  99. codeveto/statements.py +607 -0
  100. codeveto/worktree.py +1176 -0
  101. codeveto/yamlish.py +1179 -0
  102. codeveto-0.1.0.dist-info/METADATA +253 -0
  103. codeveto-0.1.0.dist-info/RECORD +106 -0
  104. codeveto-0.1.0.dist-info/WHEEL +4 -0
  105. codeveto-0.1.0.dist-info/entry_points.txt +2 -0
  106. codeveto-0.1.0.dist-info/licenses/LICENSE +21 -0
@@ -0,0 +1,466 @@
1
+ """Examples for the hygiene pack."""
2
+
3
+ from codeveto.rules.base import Change, Example, bad, good
4
+
5
+ EXAMPLES = {
6
+ "hygiene/conflict-marker": [
7
+ bad(
8
+ "src/shop/cart.py",
9
+ "def total(items):\n"
10
+ "<<<<<<< HEAD # expect\n"
11
+ " return sum(item.price for item in items)\n"
12
+ "======= # expect\n"
13
+ " return round(sum(item.price for item in items), 2)\n"
14
+ ">>>>>>> feature/rounding # expect\n",
15
+ old="def total(items):\n return sum(item.price for item in items)\n",
16
+ note="An unresolved merge left both versions in a Python module.",
17
+ ),
18
+ bad(
19
+ "README.md",
20
+ "# Setup\n"
21
+ "\n"
22
+ "<<<<<<< HEAD <!-- expect -->\n"
23
+ "Install with pip.\n"
24
+ "======= <!-- expect -->\n"
25
+ "Install with uv.\n"
26
+ ">>>>>>> main <!-- expect -->\n",
27
+ old="# Setup\n\nInstall with pip.\n",
28
+ note="Markers outside a fenced code block in Markdown are real conflicts.",
29
+ ),
30
+ bad(
31
+ "internal/limits/limits.go",
32
+ "package limits\n"
33
+ "\n"
34
+ "<<<<<<< ours // expect\n"
35
+ "const Max = 10\n"
36
+ "||||||| base // expect\n"
37
+ "const Max = 5\n"
38
+ "======= // expect\n"
39
+ "const Max = 20\n"
40
+ ">>>>>>> theirs // expect\n",
41
+ note="diff3-style conflicts also carry a ||||||| base marker.",
42
+ ),
43
+ bad(
44
+ "tests/test_merge.py",
45
+ 'CONFLICTED = """\\\n'
46
+ "<<<<<<< HEAD # expect\n"
47
+ "a = 1\n"
48
+ "======= # expect\n"
49
+ "a = 2\n"
50
+ ">>>>>>> other # expect\n"
51
+ '"""\n',
52
+ note="The rule cannot tell a fixture from a real conflict: ignore fixture paths in "
53
+ "the trusted config instead.",
54
+ ),
55
+ good(
56
+ "docs/merging.md",
57
+ "## Resolving conflicts\n"
58
+ "\n"
59
+ "Git marks both versions of a conflicting hunk:\n"
60
+ "\n"
61
+ "```text\n"
62
+ "<<<<<<< HEAD\n"
63
+ "ours\n"
64
+ "=======\n"
65
+ "theirs\n"
66
+ ">>>>>>> branch\n"
67
+ "```\n",
68
+ note="Markers inside a Markdown fenced code block are documentation.",
69
+ ),
70
+ good(
71
+ "CHANGES.md",
72
+ "Release notes\n=======\n\nThe parser accepts trailing commas.\n",
73
+ note="A lone ======= is a heading underline.",
74
+ ),
75
+ good(
76
+ "docs/thread.txt",
77
+ ">>>>>>> On Tuesday, Ana wrote:\n>>>>>>> Ship it.\n",
78
+ note="A deeply nested mail quote is not a conflict block.",
79
+ ),
80
+ good(
81
+ "docs/git.rst",
82
+ "Merging\n=======\n\nExample::\n\n <<<<<<< HEAD\n ours\n =======\n"
83
+ " theirs\n >>>>>>> branch\n",
84
+ note="Indented markers (a literal block, a YAML block scalar) are examples.",
85
+ ),
86
+ good(
87
+ "notes.txt",
88
+ "<<<<<<< HEAD\nkept as is\n=======\nalso kept\n>>>>>>> old\nnew line\n",
89
+ old="<<<<<<< HEAD\nkept as is\n=======\nalso kept\n>>>>>>> old\n",
90
+ note="An existing conflict block whose markers did not change is not re-reported.",
91
+ ),
92
+ ],
93
+ "hygiene/nul-in-source": [
94
+ bad(
95
+ "src/app/codec.py",
96
+ 'MAGIC = b"PK"\nSEP = "a\x00b" # expect\n',
97
+ old='MAGIC = b"PK"\n',
98
+ note="A raw NUL character, not the escape sequence, in a Python string.",
99
+ ),
100
+ bad(
101
+ "scripts/setup.sh",
102
+ "#!/bin/sh\necho ready\x00 # expect\n",
103
+ note="A shebang keeps the file text even with a NUL byte.",
104
+ ),
105
+ good("src/app/codec.py", 'SEP = "a\\x00b"\n', note="The escape sequence is fine."),
106
+ good("src/app/codec.go", 'package codec\n\nconst Sep = "\\x00"\n'),
107
+ ],
108
+ "hygiene/debug-artifact": [
109
+ Example(
110
+ kind="bad",
111
+ files={"core.48213": Change(new="", binary=True, size=4096)},
112
+ expect=(("core.48213", None, "new"),),
113
+ note="A core dump holds the memory of the crashed process.",
114
+ ),
115
+ bad(
116
+ "npm-debug.log",
117
+ "0 info it worked if it ends with ok\n",
118
+ expect=[("npm-debug.log", None, "new")],
119
+ ),
120
+ bad(
121
+ "src/app/models.py.orig",
122
+ "class Order:\n pass\n",
123
+ expect=[("src/app/models.py.orig", None, "new")],
124
+ note="A leftover of a merge tool or patch.",
125
+ ),
126
+ Example(
127
+ kind="bad",
128
+ files={"heap/app.heapsnapshot": Change(new='{"snapshot": {}}\n')},
129
+ expect=(("heap/app.heapsnapshot", None, "new"),),
130
+ ),
131
+ good("bin/core", '#!/bin/sh\nexec python -m app.core "$@"\n', note="A script named core."),
132
+ good(
133
+ "third-party/crates/itoa-1.0.19/Cargo.toml.orig",
134
+ '[package]\nname = "itoa"\nversion = "1.0.19"\n',
135
+ note="The original manifest cargo package ships in every crate.",
136
+ ),
137
+ good(
138
+ "tests/fixtures/conflict.rej",
139
+ "--- a/x\n+++ b/x\n",
140
+ note="Patch tools keep .rej fixtures in their tests.",
141
+ ),
142
+ good("src/app/core.py", "def main():\n return 0\n"),
143
+ ],
144
+ "hygiene/symlink-escapes-repo": [
145
+ Example(
146
+ kind="bad",
147
+ files={"config/credentials": Change(new="/home/ci/.aws/credentials", mode="120000")},
148
+ expect=(("config/credentials", None, "new"),),
149
+ note="An absolute target reads from outside the checkout.",
150
+ ),
151
+ Example(
152
+ kind="bad",
153
+ files={"docs/shared": Change(new="../../shared/docs", mode="120000")},
154
+ expect=(("docs/shared", None, "new"),),
155
+ note="Two levels up from docs/ is above the repository root.",
156
+ ),
157
+ Example(
158
+ kind="good",
159
+ files={"docs/README.md": Change(new="../README.md", mode="120000")},
160
+ note="One level up from docs/ is the repository root.",
161
+ ),
162
+ Example(
163
+ kind="good",
164
+ files={"web/assets/logo.svg": Change(new="./../../brand/logo.svg", mode="120000")},
165
+ ),
166
+ ],
167
+ "hygiene/symlink-added": [
168
+ Example(
169
+ kind="bad",
170
+ files={"docs/README.md": Change(new="../README.md", mode="120000")},
171
+ expect=(("docs/README.md", None, "new"),),
172
+ ),
173
+ Example(
174
+ kind="bad",
175
+ files={"bin/tool": Change(new="../scripts/tool.sh", mode="120000")},
176
+ expect=(("bin/tool", None, "new"),),
177
+ ),
178
+ Example(
179
+ kind="good",
180
+ files={
181
+ "docs/README.md": Change(old="../README.md", new="../README.rst", mode="120000")
182
+ },
183
+ note="Retargeting an existing link is not adding one.",
184
+ ),
185
+ Example(
186
+ kind="good",
187
+ files={"docs/README.md": Change(old="../README.md", mode="120000")},
188
+ note="Removing a link.",
189
+ ),
190
+ ],
191
+ "hygiene/large-file": [
192
+ Example(
193
+ kind="bad",
194
+ files={"data/cities.csv": Change(new="name,country\nZurich,CH\n", size=900 * 1024)},
195
+ expect=(("data/cities.csv", None, "new"),),
196
+ ),
197
+ Example(
198
+ kind="bad",
199
+ files={
200
+ "src/app/fixtures.py": Change(
201
+ old="ROWS = []\n", new="ROWS = [1, 2, 3]\n", size=600 * 1024
202
+ )
203
+ },
204
+ expect=(("src/app/fixtures.py", 1, "new"),),
205
+ note="A file that grows past 512 KiB.",
206
+ ),
207
+ Example(
208
+ kind="good",
209
+ files={"package-lock.json": Change(new='{"lockfileVersion": 3}\n', size=2048 * 1024)},
210
+ note="Lockfiles are large by nature.",
211
+ ),
212
+ Example(
213
+ kind="good",
214
+ files={"data/cities.csv": Change(new="name,country\nZurich,CH\n", size=500 * 1024)},
215
+ ),
216
+ ],
217
+ "hygiene/blanket-suppression": [
218
+ bad(
219
+ "src/app/views.py",
220
+ "from app.models import * # noqa # expect\n",
221
+ note="A bare noqa silences every check on the line.",
222
+ ),
223
+ bad(
224
+ "src/app/client.py",
225
+ "value = payload.get('id') # type: ignore # expect\n",
226
+ ),
227
+ bad("web/src/legacy.ts", "// @ts-nocheck // expect\nexport const x = 1;\n"),
228
+ bad("web/src/legacy.js", "/* eslint-disable */ // expect\nexport const x = 1;\n"),
229
+ bad(
230
+ "internal/run/run.go",
231
+ "package run\n\nfunc Run() {\n\tdefer f.Close() //nolint // expect\n}\n",
232
+ ),
233
+ bad("src/lib.rs", "#![allow(warnings)] // expect\npub fn f() {}\n"),
234
+ good(
235
+ "src/app/views.py",
236
+ "from app.models import * # noqa: F403\n"
237
+ "value = payload.get('id') # type: ignore[union-attr]\n",
238
+ ),
239
+ good(
240
+ "web/src/legacy.js",
241
+ "// eslint-disable-next-line no-console\nconsole.log('ready');\n",
242
+ ),
243
+ good(
244
+ "internal/run/run.go",
245
+ "package run\n\nfunc Run() {\n\tdefer f.Close() //nolint:errcheck\n}\n",
246
+ ),
247
+ good(
248
+ "src/app/docs.py",
249
+ "# Never write a bare noqa comment in this module.\nVALUE = 1\n",
250
+ note="A comment that only mentions noqa.",
251
+ ),
252
+ ],
253
+ "hygiene/quality-gate-weakened": [
254
+ bad(
255
+ "tsconfig.json",
256
+ '{\n "compilerOptions": {\n "strict": false // expect\n }\n}\n',
257
+ old='{\n "compilerOptions": {\n "strict": true\n }\n}\n',
258
+ ),
259
+ bad(
260
+ "pyproject.toml",
261
+ '[tool.ruff.lint]\nselect = ["E", "F"]\nignore = ["E501", "F401"] # expect\n',
262
+ old='[tool.ruff.lint]\nselect = ["E", "F"]\nignore = ["E501"]\n',
263
+ ),
264
+ bad(
265
+ ".eslintrc.json",
266
+ '{\n "rules": {\n "eqeqeq": "error",\n "no-console": "off" // expect\n }\n}\n',
267
+ old='{\n "rules": {\n "eqeqeq": "error"\n }\n}\n',
268
+ ),
269
+ bad(
270
+ "eslint.config.js",
271
+ "export default [\n {\n rules: {\n"
272
+ " 'no-unused-vars': 'off', // expect\n },\n },\n];\n",
273
+ old="export default [\n {\n rules: {\n },\n },\n];\n",
274
+ ),
275
+ bad(
276
+ "mypy.ini",
277
+ "[mypy]\nstrict = True\n\n[mypy-app.legacy.*]\nignore_errors = True # expect\n",
278
+ old="[mypy]\nstrict = True\n",
279
+ ),
280
+ good(
281
+ "tsconfig.json",
282
+ '{\n "compilerOptions": {\n "strict": true,\n "target": "es2022"\n }\n}\n',
283
+ old='{\n "compilerOptions": {\n "strict": true\n }\n}\n',
284
+ ),
285
+ good(
286
+ "pyproject.toml",
287
+ '[tool.ruff.lint]\nselect = ["E", "F", "B"]\nignore = ["E501"]\n',
288
+ old='[tool.ruff.lint]\nselect = ["E", "F"]\nignore = ["E501"]\n',
289
+ note="Selecting more rules tightens the gate.",
290
+ ),
291
+ good(
292
+ ".eslintrc.json",
293
+ '{\n "rules": {\n "no-console": "error"\n }\n}\n',
294
+ old='{\n "rules": {\n "no-console": "off"\n }\n}\n',
295
+ note="Turning a rule on is the opposite of weakening.",
296
+ ),
297
+ ],
298
+ "hygiene/generated-file-edited": [
299
+ bad(
300
+ "dist/app.js",
301
+ "export const version = '1.2.1'; // expect\n",
302
+ old="export const version = '1.2.0';\n",
303
+ note="A hand edit to a build output.",
304
+ ),
305
+ bad(
306
+ "internal/api/types.go",
307
+ "// Code generated by apigen. DO NOT EDIT. // expect\n\npackage api\n",
308
+ old="package api\n",
309
+ ),
310
+ good(
311
+ "dist/app.js",
312
+ "export const version = '1.2.0';\n",
313
+ note="Adding a build output is not editing one.",
314
+ ),
315
+ good(
316
+ "internal/api/types.go",
317
+ "// Code generated by apigen. DO NOT EDIT.\n\npackage api\n\ntype ID string\n",
318
+ old="// Code generated by apigen. DO NOT EDIT.\n\npackage api\n",
319
+ note="The marker was already there.",
320
+ ),
321
+ good(
322
+ "src/app/gen.py",
323
+ 'MARKER = "@generated"\n',
324
+ note="The marker in a string is data, not a marker.",
325
+ ),
326
+ ],
327
+ "hygiene/minified-file": [
328
+ bad(
329
+ "static/vendor.min.js",
330
+ "!function(e){return e}(window);\n",
331
+ expect=[("static/vendor.min.js", None, "new")],
332
+ ),
333
+ bad(
334
+ "src/widget.js",
335
+ "var a=" + "f(1),g(2),h(3);" * 200 + "\n",
336
+ expect=[("src/widget.js", None, "new")],
337
+ note="Minified JavaScript under an ordinary name.",
338
+ ),
339
+ good("src/widget.js", "export function widget() {\n return 1;\n}\n"),
340
+ good(
341
+ "src/data.js",
342
+ "export const WORDS = [" + "'alpha', 'beta', " * 150 + "];\n",
343
+ note="A long line of readable code is not minified.",
344
+ ),
345
+ ],
346
+ "hygiene/binary-file": [
347
+ Example(
348
+ kind="bad",
349
+ files={"tools/protoc": Change(new="", binary=True, mode="100755", size=1 << 20)},
350
+ expect=(("tools/protoc", None, "new"),),
351
+ note="An executable binary (error).",
352
+ ),
353
+ Example(
354
+ kind="bad",
355
+ files={"lib/libfast.so": Change(new="", binary=True, size=1 << 16)},
356
+ expect=(("lib/libfast.so", None, "new"),),
357
+ note="A native library (error).",
358
+ ),
359
+ Example(
360
+ kind="bad",
361
+ files={"vendor/plugin.jar": Change(new="", binary=True, size=1 << 16)},
362
+ expect=(("vendor/plugin.jar", None, "new"),),
363
+ note="An archive (warning).",
364
+ ),
365
+ Example(
366
+ kind="bad",
367
+ files={"assets/font.woff2": Change(new="", binary=True, size=1 << 12)},
368
+ expect=(("assets/font.woff2", None, "new"),),
369
+ note="Any other binary (note).",
370
+ ),
371
+ Example(
372
+ kind="good",
373
+ files={"lib/libold.so": Change(old="", binary=True)},
374
+ note="Deleting a binary.",
375
+ ),
376
+ Example(
377
+ kind="good",
378
+ files={
379
+ "lib/libfast.so": Change(old="x", new="x", old_path="bin/libfast.so", binary=True)
380
+ },
381
+ note="A pure rename keeps the same content.",
382
+ ),
383
+ ],
384
+ "hygiene/todo-added": [
385
+ bad(
386
+ "src/app/cart.py",
387
+ "def total(items):\n # TODO: apply discounts # expect\n return 0\n",
388
+ ),
389
+ bad("web/src/cart.ts", "export const x = 1; // FIXME rounding // expect\n"),
390
+ good("src/app/cart.py", 'TODO_LIST = "todo"\nlabel = "TODO"\n', note="Strings are data."),
391
+ good(
392
+ "src/app/phone.py",
393
+ "# Format: XXX-XXXX\nPATTERN = r'\\d{3}-\\d{4}'\n",
394
+ note="A placeholder pattern is not a TODO.",
395
+ ),
396
+ ],
397
+ "hygiene/commented-out-code": [
398
+ bad(
399
+ "src/app/cart.py",
400
+ "def total(items):\n"
401
+ " # discount = compute_discount(items) # expect\n"
402
+ " # if discount:\n"
403
+ " # return sum(items) - discount\n"
404
+ " return sum(items)\n",
405
+ ),
406
+ bad(
407
+ "web/src/cart.ts",
408
+ "export function total(items: number[]): number {\n"
409
+ " // const discount = computeDiscount(items); // expect\n"
410
+ " // if (discount > 0) {\n"
411
+ " // return sum(items) - discount;\n"
412
+ " // }\n"
413
+ " return sum(items);\n"
414
+ "}\n",
415
+ ),
416
+ good(
417
+ "src/app/cart.py",
418
+ "def total(items):\n"
419
+ " # Sum the item prices. Discounts are applied later,\n"
420
+ " # by the checkout service, so they are not part of\n"
421
+ " # this total.\n"
422
+ " return sum(items)\n",
423
+ note="Prose comments.",
424
+ ),
425
+ good(
426
+ "src/lib.rs",
427
+ "/// Adds one.\n///\n/// ```\n/// let x = add_one(1);\n/// assert_eq!(x, 2);\n/// ```\n"
428
+ "pub fn add_one(x: i32) -> i32 {\n x + 1\n}\n",
429
+ note="Doc comment examples are documentation.",
430
+ ),
431
+ good(
432
+ "src/app/notes.py",
433
+ "# Steps:\n# Parse input\n# Validate fields\n# Save record\nVALUE = 1\n",
434
+ ),
435
+ ],
436
+ "hygiene/executable-bit": [
437
+ Example(
438
+ kind="bad",
439
+ files={
440
+ "config/app.yaml": Change(old="port: 8080\n", new="port: 8080\n", mode="100755")
441
+ },
442
+ expect=(("config/app.yaml", None, "new"),),
443
+ ),
444
+ Example(
445
+ kind="bad",
446
+ files={"README.md": Change(old="# Shop\n", new="# Shop\n", mode="100755")},
447
+ expect=(("README.md", None, "new"),),
448
+ ),
449
+ Example(
450
+ kind="good",
451
+ files={
452
+ "scripts/release": Change(
453
+ old="#!/bin/sh\necho\n", new="#!/bin/sh\necho\n", mode="100755"
454
+ )
455
+ },
456
+ note="A script with a shebang.",
457
+ ),
458
+ Example(
459
+ kind="good",
460
+ files={
461
+ "scripts/build.sh": Change(old="echo build\n", new="echo build\n", mode="100755")
462
+ },
463
+ note="A shell script by extension.",
464
+ ),
465
+ ],
466
+ }