-
Improvement
-
Resolution: Unresolved
-
Major
-
None
It would be interesting to see if we could inspect script and expression blocks in Declarative validation and look for instances of use cases/patterns/strings that could be replaced by a standard Declarative directive/condition/option, or which served no purpose at all. We'd log those as compiler warnings with a short "hey, don't do that, do this [link to example]", with a page on jenkins.io for the examples. This could look for things like:
- Setting currentBuild.result = "FAILURE" in a post failure block - that's just totally redundant, why bother.
- expression blocks that are just if (foo == "bar") (which can be replaced with the equals condition) and other simple if clauses that have direct equivalent conditions.
- ...ok, need to think of more.