mirror of
https://github.com/OpenAPITools/openapi-generator.git
synced 2025-12-09 03:46:10 +00:00
[sonar] Java 11, use -nsu, exclude maven/online projects (#7459)
This commit is contained in:
@@ -39,15 +39,16 @@ import java.util.stream.Collectors;
|
||||
import static org.apache.commons.lang3.StringEscapeUtils.escapeHtml4;
|
||||
import static org.apache.commons.lang3.StringUtils.isEmpty;
|
||||
|
||||
@SuppressWarnings({"unused","java:S106"})
|
||||
@SuppressWarnings({"unused","java:S106", "java:S1192"})
|
||||
@Command(name = "config-help", description = "Config help for chosen lang")
|
||||
public class ConfigHelp extends OpenApiGeneratorCommand {
|
||||
|
||||
private static final Logger LOGGER = LoggerFactory.getLogger(Generate.class);
|
||||
private static final Logger LOGGER = LoggerFactory.getLogger(ConfigHelp.class);
|
||||
|
||||
private static final String FORMAT_TEXT = "text";
|
||||
private static final String FORMAT_MARKDOWN = "markdown";
|
||||
private static final String FORMAT_YAMLSAMPLE = "yamlsample";
|
||||
private static final int FEATURE_SET_DISPLAY_WIDTH= 20;
|
||||
|
||||
@Option(name = {"-g",
|
||||
"--generator-name"}, title = "generator name", description = "generator to get config help for")
|
||||
@@ -147,7 +148,7 @@ public class ConfigHelp extends OpenApiGeneratorCommand {
|
||||
LOGGER.error("[error] Check the spelling of the generator's name and try again.");
|
||||
System.exit(1);
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
LOGGER.error("Unexpected error", e);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -396,7 +397,7 @@ public class ConfigHelp extends OpenApiGeneratorCommand {
|
||||
String definedByKey = "Defined By";
|
||||
int maxNameLength = flattened.stream().map(FeatureSet.FeatureSetFlattened::getFeatureName).mapToInt(String::length).max().orElse(nameKey.length());
|
||||
int maxSupportedLength = supportedKey.length();
|
||||
int definedInLength = 20;
|
||||
int definedInLength = FEATURE_SET_DISPLAY_WIDTH;
|
||||
String format = "%-" + maxNameLength + "s\t%-" + maxSupportedLength + "s\t%-" + definedInLength + "s";
|
||||
|
||||
flattened.forEach(featureSet -> {
|
||||
|
||||
Reference in New Issue
Block a user