blob: 0d0b712c2f54329dcdde4ab708e786744a517a2f [file] [log] [blame]
Ivan Lozanoe169ad72019-09-18 08:42:54 -07001package config
2
3var (
Thiébaud Weksteen425a5422020-08-06 20:20:19 +02004 // When adding a new path below, add a rustfmt.toml file at the root of
Andrew Scull5a58bca2020-10-13 13:49:29 +01005 // the repository and enable the rustfmt repo hook. See aosp/1458238
Thiébaud Weksteen425a5422020-08-06 20:20:19 +02006 // for an example.
7 // TODO(b/160223496): enable rustfmt globally.
Ivan Lozanoe169ad72019-09-18 08:42:54 -07008 RustAllowedPaths = []string{
A. Cody Schuffelen4e5fc3b2020-11-25 18:29:39 -08009 "device/google/cuttlefish",
Alistair Delvae172eaf2020-10-21 06:56:13 -070010 "external/adhd",
11 "external/crosvm",
Victor Hsieh274597b2020-12-03 16:08:43 -080012 "external/libchromeos-rs",
Lingfeng Yang0f8c5b42020-02-20 07:27:15 -080013 "external/minijail",
Janis Danisevskis73f21042021-11-12 10:06:35 -080014 "external/open-dice",
Chih-Hung Hsiehc74d7232019-10-25 10:01:42 -070015 "external/rust",
Joel Galensone4d63902021-08-10 11:54:14 -070016 "external/selinux/libselinux",
Matthew Maurer80f0eb12021-08-26 20:36:37 +000017 "external/uwb",
Alistair Delvaea2974c2020-10-21 06:56:58 -070018 "external/vm_tools/p9",
Stephen Cranefb67ab52020-05-06 14:28:21 -070019 "frameworks/native/libs/binder/rust",
Joel Galenson77a684e2021-02-17 11:22:38 -080020 "frameworks/proto_logging/stats",
Janis Danisevskisa9029d12021-11-09 07:56:28 -080021 "hardware/interfaces/security",
Baligh Uddin5dd07e52021-11-06 01:41:50 +000022 "packages/modules/Bluetooth",
Bernie Innocenti3a710d62020-12-05 02:55:53 +090023 "packages/modules/DnsResolver",
ziyiwf3d02222021-10-27 17:32:55 +000024 "packages/modules/Uwb",
Andrew Scullaf2015d2020-10-13 11:42:28 +010025 "packages/modules/Virtualization",
Matthew Maurer99020b02019-10-31 10:44:40 -070026 "prebuilts/rust",
Joel Galensonf4b139a2021-03-30 13:39:45 -070027 "system/core/libstats/pull_rust",
Yi Kong91c3e4e2020-08-05 01:03:05 +080028 "system/extras/profcollectd",
Yi Kong2c9b3e02021-01-27 15:48:31 +080029 "system/extras/simpleperf",
Janis Danisevskis1edd0392020-09-30 14:28:07 -070030 "system/hardware/interfaces/keystore2",
Joel Galenson84be2fc2021-07-29 15:40:23 -070031 "system/librustutils",
Joel Galensona7614dd2021-08-23 14:02:49 -070032 "system/logging/liblog",
Bram Bonnée45541d2021-03-25 19:06:42 +010033 "system/logging/rust",
Zach Johnson5145e9d2021-09-17 12:08:07 -070034 "system/nfc",
Janis Danisevskis8b7eb8d2020-07-20 09:15:16 -070035 "system/security",
Andrei Homescu834152c2020-07-31 19:52:45 -070036 "system/tools/aidl",
Ivan Lozano03a94c42021-06-28 11:27:11 -040037 "tools/security/fuzzing/example_rust_fuzzer",
Joel Galensond9931552021-10-21 14:28:00 -070038 "tools/security/fuzzing/orphans",
Ivan Lozanodca00cb2021-07-27 11:57:57 -040039 "vendor/",
Ivan Lozano03a94c42021-06-28 11:27:11 -040040 }
41
42 DownstreamRustAllowedPaths = []string{
43 // Add downstream allowed Rust paths here.
Ivan Lozanoe169ad72019-09-18 08:42:54 -070044 }
45
46 RustModuleTypes = []string{
Ivan Lozano03a94c42021-06-28 11:27:11 -040047 // Don't add rust_bindgen or rust_protobuf as these are code generation modules
48 // and can be expected to be in paths without Rust code.
49 "rust_benchmark",
50 "rust_benchmark_host",
Ivan Lozanoe169ad72019-09-18 08:42:54 -070051 "rust_binary",
52 "rust_binary_host",
53 "rust_library",
54 "rust_library_dylib",
55 "rust_library_rlib",
Matthew Maurer2ae05132020-06-23 14:28:53 -070056 "rust_ffi",
57 "rust_ffi_shared",
58 "rust_ffi_static",
Ivan Lozano03a94c42021-06-28 11:27:11 -040059 "rust_fuzz",
Ivan Lozanoe169ad72019-09-18 08:42:54 -070060 "rust_library_host",
61 "rust_library_host_dylib",
62 "rust_library_host_rlib",
Matthew Maurer2ae05132020-06-23 14:28:53 -070063 "rust_ffi_host",
64 "rust_ffi_host_shared",
65 "rust_ffi_host_static",
Ivan Lozanoe169ad72019-09-18 08:42:54 -070066 "rust_proc_macro",
Ivan Lozano8a342872019-11-14 07:36:22 -080067 "rust_test",
68 "rust_test_host",
Ivan Lozanoe169ad72019-09-18 08:42:54 -070069 }
70)