Use the :reflection linter to systematically avoid reflection
masterThe :reflection linter helps you identify and address reflection warnings from the Clojure compiler. Addressing these improves performance, maintainability, and compatibility with newer JDKs and GraalVM.
Key Behaviors:
- Scope: By default, it only emits warnings if reflection occurs within your project's source or test paths.
- Overrides: It ignores any
(set! warn-on-reflection ...)settings in a namespace, as Eastwood analyzes each top-level form with a binding that overrides the surrounding choice. - Macros: If a third-party macro expands to reflective access within your source path, it will be reported, as this creates reflective code in your codebase.