blob: 9b88b6d812961ae66fc2da4f4a05d8f22a3449c8 [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",
Chih-Hung Hsiehc74d7232019-10-25 10:01:42 -070014 "external/rust",
Joel Galensone4d63902021-08-10 11:54:14 -070015 "external/selinux/libselinux",
Matthew Maurer80f0eb12021-08-26 20:36:37 +000016 "external/uwb",
Alistair Delvaea2974c2020-10-21 06:56:58 -070017 "external/vm_tools/p9",
Stephen Cranefb67ab52020-05-06 14:28:21 -070018 "frameworks/native/libs/binder/rust",
Joel Galenson77a684e2021-02-17 11:22:38 -080019 "frameworks/proto_logging/stats",
Janis Danisevskisa9029d12021-11-09 07:56:28 -080020 "hardware/interfaces/security",
Baligh Uddin5dd07e52021-11-06 01:41:50 +000021 "packages/modules/Bluetooth",
Bernie Innocenti3a710d62020-12-05 02:55:53 +090022 "packages/modules/DnsResolver",
ziyiwf3d02222021-10-27 17:32:55 +000023 "packages/modules/Uwb",
Andrew Scullaf2015d2020-10-13 11:42:28 +010024 "packages/modules/Virtualization",
Matthew Maurer99020b02019-10-31 10:44:40 -070025 "prebuilts/rust",
Joel Galensonf4b139a2021-03-30 13:39:45 -070026 "system/core/libstats/pull_rust",
Yi Kong91c3e4e2020-08-05 01:03:05 +080027 "system/extras/profcollectd",
Yi Kong2c9b3e02021-01-27 15:48:31 +080028 "system/extras/simpleperf",
Janis Danisevskis1edd0392020-09-30 14:28:07 -070029 "system/hardware/interfaces/keystore2",
Joel Galenson84be2fc2021-07-29 15:40:23 -070030 "system/librustutils",
Joel Galensona7614dd2021-08-23 14:02:49 -070031 "system/logging/liblog",
Bram Bonnée45541d2021-03-25 19:06:42 +010032 "system/logging/rust",
Zach Johnson5145e9d2021-09-17 12:08:07 -070033 "system/nfc",
Janis Danisevskis8b7eb8d2020-07-20 09:15:16 -070034 "system/security",
Andrei Homescu834152c2020-07-31 19:52:45 -070035 "system/tools/aidl",
Ivan Lozano03a94c42021-06-28 11:27:11 -040036 "tools/security/fuzzing/example_rust_fuzzer",
Joel Galensond9931552021-10-21 14:28:00 -070037 "tools/security/fuzzing/orphans",
Ivan Lozanodca00cb2021-07-27 11:57:57 -040038 "vendor/",
Ivan Lozano03a94c42021-06-28 11:27:11 -040039 }
40
41 DownstreamRustAllowedPaths = []string{
42 // Add downstream allowed Rust paths here.
Ivan Lozanoe169ad72019-09-18 08:42:54 -070043 }
44
45 RustModuleTypes = []string{
Ivan Lozano03a94c42021-06-28 11:27:11 -040046 // Don't add rust_bindgen or rust_protobuf as these are code generation modules
47 // and can be expected to be in paths without Rust code.
48 "rust_benchmark",
49 "rust_benchmark_host",
Ivan Lozanoe169ad72019-09-18 08:42:54 -070050 "rust_binary",
51 "rust_binary_host",
52 "rust_library",
53 "rust_library_dylib",
54 "rust_library_rlib",
Matthew Maurer2ae05132020-06-23 14:28:53 -070055 "rust_ffi",
56 "rust_ffi_shared",
57 "rust_ffi_static",
Ivan Lozano03a94c42021-06-28 11:27:11 -040058 "rust_fuzz",
Ivan Lozanoe169ad72019-09-18 08:42:54 -070059 "rust_library_host",
60 "rust_library_host_dylib",
61 "rust_library_host_rlib",
Matthew Maurer2ae05132020-06-23 14:28:53 -070062 "rust_ffi_host",
63 "rust_ffi_host_shared",
64 "rust_ffi_host_static",
Ivan Lozanoe169ad72019-09-18 08:42:54 -070065 "rust_proc_macro",
Ivan Lozano8a342872019-11-14 07:36:22 -080066 "rust_test",
67 "rust_test_host",
Ivan Lozanoe169ad72019-09-18 08:42:54 -070068 }
69)