This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
In the OnSave panel in Options window, all the items under Source | Inspect and Refactor | Inspect and Transform should be available. In that way, user should be able to select the inspections that are executed on saving a file.
Hm, on the lowest level, the internal infrastructure is the same - the difference between On Save and Inspect&Transform is mostly the UI. Placing a fixable hint into On Save list brings some challenges, though: a) it needs to be decided if it should have an option to be applied only on modified lines. If yes, then there is currently no infrastructure support for this, so it would need to be added (this option does not make much sense for Organize Imports/Members, but might make sense for e.g. Make fields final). b) the quality requirements on hints in the On Save list are much higher than for "normal" hints: a misbehaving hint may render the IDE virtually unusable. This is not only a development constraint, it is also a testing constraint: someone needs to test the hint much better. So, I don't think we can commit to just adding all fixable hints into the On Save list (and to simply let new ones appear there as new hints are created). I would much more prefer to add specific hints in testable and fixable amounts as found useful.
I'm fine with that. I'm thinking specifically about Java Code Metrics, i.e., on save, run Java Code Metrics so the developer can see the current state of metrics based on latest changes.
Is it really necessary to run inspect & transform on save ? For example IDEA allows to configure inspections before commit into VCS; in the case the inspection founds some errors, the commit is delayed -- the user is warned with an option to commit anyway or review the potential defects found.
Wow, that would be great. That is a better idea than mine. My main concern is that we need to integrate these inspections into the workflow, rather than requiring the user to take separate steps to perform the inspections. I.e., if they happen somewhere automatically, that would be brilliant and I agree with the scenario you describe. This will be great.
(In reply to Svata Dedic from comment #3) > Is it really necessary to run inspect & transform on save ? For example IDEA > allows to configure inspections before commit into VCS; in the case the > inspection founds some errors, the commit is delayed -- the user is warned > with an option to commit anyway or review the potential defects found. Duplicate of https://netbeans.org/bugzilla/show_bug.cgi?id=204063 *** This bug has been marked as a duplicate of bug 204063 ***