What's the proper way to mark some lints as only usable at crate level? I want to emit a warning or an error when user attempts to tune its level at finer grained level.
you can use https://doc.rust-lang.org/nightly/nightly-rustc/rustc_lint/trait.LateLintPass.html#method.enter_lint_attrs to error on specific attributes. You'll need to store a flag in your lint pass struct so you don't lint on the crate attributes and then change that flag in
check_crate at which point the first
enter_lint_attrs will already have been called