aboutsummaryrefslogtreecommitdiffstats
path: root/servo-tidy.toml
blob: 2194a0db53afdb81ad64f9761873780b6e49ef31 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
[configs]
skip-check-length = false
skip-check-licenses = false
check-alphabetical-order = true
check-ordered-json-keys = ["./resources/prefs.json"]

# Packages which we avoid using in Servo.
# For each blocked package, we can list the exceptions,
# which are packages allowed to use the blocked package.
[blocked-packages]
num = []
rand = [
  "ipc-channel",
  "phf_generator",
  "quickcheck",    # Only used in tests
  "servo_rand",
  "tungstenite",
  "ws",
]

[ignore]
# Ignored packages with duplicated versions
packages = [
  "arrayvec",
  "base64",
  "cfg-if",
  "cookie",
  "crossbeam-channel",
  "crossbeam-utils",
  "fixedbitset",
  "getrandom",
  "half",
  "image",
  "itoa",
  "libloading",
  "metal",
  "miniz_oxide",
  "num-rational",
  "parking_lot",
  "parking_lot_core",
  "petgraph",
  "png",
  "rand",
  "rand_chacha",
  "rand_core",
  "redox_syscall",
  "ron",
  "time",
  "wasi",
  "wayland-sys",

  # https://github.com/servo/servo/issues/26933
  "bytes",
  "futures",
  "mio",

  # https://github.com/servo/servo/pull/23288#issuecomment-494687746
  "gl_generator",

  # https://github.com/servo/servo/pull/25518
  "core-foundation",
  "core-foundation-sys",
  "lyon_geom",

  # https://github.com/servo/servo/pull/28236
  "nix",

  # Duplicated by webrender debugger via ws
  "block-buffer",
  "digest",
  "generic-array",

  # Duplicated by winit/surfman update.
  "raw-window-handle",

  # Temporarily duplicated until ipc-channels and gleam can be upgrded.
  "uuid",
]
# Files that are ignored for all tidy and lint checks.
files = [
  "./components/net/tests/parsable_mime/text",
  # These are ignored to avoid diverging from Gecko
  "./components/style/counter_style/mod.rs",
  "./components/style/properties/declaration_block.rs",
  "./components/style/properties/helpers.mako.rs",
  "./components/style/rule_collector.rs",
  "./components/style/selector_map.rs",
  "./components/style/stylesheets/import_rule.rs",
  "./components/style/stylesheets/layer_rule.rs",
  "./components/style/stylesheets/origin.rs",
  "./components/style/stylesheets/page_rule.rs",
  "./components/style/stylesheets/rule_parser.rs",
  "./components/style/stylesheets/scroll_timeline_rule.rs",
  "./components/style/stylist.rs",
  "./components/style/values/animated/transform.rs",
  "./components/style/values/computed/font.rs",
  "./components/style/values/computed/image.rs",
  "./components/style/values/specified/box.rs",
  "./components/style/values/specified/color.rs",
  "./components/style/values/specified/transform.rs",
  # Mako does not lend itself easily to splitting long lines
  "./components/style/properties/helpers/animated_properties.mako.rs",
  "./components/style/properties/shorthands/text.mako.rs",
  # Long regexes are long.
  "./components/style/gecko/regen_atoms.py",
  # Helper macro where actually a pseudo-element per line makes sense.
  "./components/style/gecko/non_ts_pseudo_class_list.rs",
  "./resources/hsts_preload.json",
  "./tests/wpt/meta/MANIFEST.json",
  "./tests/wpt/meta-legacy-layout/MANIFEST.json",
  "./tests/wpt/mozilla/meta/MANIFEST.json",
  "./tests/wpt/mozilla/meta-legacy-layout/MANIFEST.json",
  # Long encoded string
  "./tests/wpt/mozilla/tests/mozilla/resources/brotli.py",
  "./tests/wpt/webgl/meta/MANIFEST.json",
  "./support/android/openssl.sh",
  # Upstream code from Khronos/WebGL uses tabs for indentation
  "./tests/wpt/webgl/tests",
  # Vendored from upstream
  "./tests/wpt/webgpu/tests",
  # Our import script is not currently respecting the lint.
  "./tests/wpt/webgl/tools/import-conformance-tests.py",
  # Ignore those files since the issues reported are on purpose
  "./tests/html/bad-line-ends.html",
  "./tests/wpt/mozilla/tests/css/fonts",
  "./tests/wpt/mozilla/tests/css/pre_with_tab.html",
  "./tests/wpt/mozilla/tests/mozilla/textarea_placeholder.html",
  # Python 3 syntax causes "E901 SyntaxError" when flake8 runs in Python 2
  "./components/style/properties/build.py",
  # The tidy tests currently don't pass tidy.
  "./python/tidy/test.py",
]
# Directories that are ignored for the non-WPT tidy check.
directories = [
  # Upstream
  "./support/android/apk",
  "./support/hololens",
  "./tests/wpt/harness",
  "./tests/wpt/tests",
  "./tests/wpt/mozilla/tests/mozilla/referrer-policy",
  "./tests/wpt/mozilla/tests/webgl",
  "./python/tidy/tests",
  "./components/script/dom/bindings/codegen/parser",
  "./components/script/dom/bindings/codegen/ply",
  "./python/_virtualenv*",
  "./python/mach",
  # Generated and upstream code combined with our own. Could use cleanup
  "./target",
]

# Directories that are checked for correct file extension
[check_ext]
# directory, list of expected file extensions
"./components/script/dom/webidls" = [".webidl"]