dylint_linting’s constituent featureThe general-purpose lints use dylint_linting’s constituent feature. This allows the lints to be built in either of the following two configurations:
general libraryHowever, some additional organization of both the general directory and its subdirectories is required.
For the general directory itself:
[dependencies] in general/Cargo.toml[workspace.members] in general/Cargo.tomlregister_lints function is called from the register_lints function in src/lib.rs.For each lint subdirectory:
cargo dylint new:
[lib] section (note: crate-type is not just ["cdylib"]):
[lib]
crate-type = ["cdylib", "rlib"]
clippy_utils dependency from the workspace, i.e.:
[dependencies]
clippy_utils = { workspace = true }
[features] section:
[features]
rlib = ["dylint_linting/constituent"]