void (@NotNull AnActionEvent e) { Project project = e.getProject(); Document document = e.getData(VcsDataKeys.COMMIT_MESSAGE_DOCUMENT); e.getPresentation().setEnabled(project != null && document != null && getEnabledInspections(project).anyMatch(inspection -> inspection.canReformat(project, document))); }