-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Code quality tooling added #2
base: master
Are you sure you want to change the base?
Conversation
String[] minimum = {"200", "202", "204", "301", "400", "404", "415", "500"}; | ||
String[] standard = {"200", "201", "202", "203", "204", "301", "304", "307", | ||
private final String[] minimum = {"200", "202", "204", "301", "400", "404", "415", "500"}; | ||
private final String[] standard = {"200", "201", "202", "203", "204", "301", "304", "307", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not
private static final String[] MINIMUM = {...}
and
private static final String[] STANDARD = {...}
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Youre right, why not - it is a part fo the latest commit, thank you for pointing to that.
@@ -143,7 +136,18 @@ public void execute() throws MojoExecutionException, MojoFailureException { | |||
); | |||
} | |||
|
|||
private void ApplySpecificHeadersAndResponses(Swagger api, Set<String> codes) { | |||
private String findFileFormat(String fileAndPathName) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could be realized with streams? Not sure whether its more readable or not but you avoid the branching. The extensions could maybe also be added to the OutputFormat
enumeration since this seems to be somewhat related to the extension - actually looking at the method name findFileFormat
I might have expected it to return a FileFormat
- it is actually returning a file name - isn't it? :-)
private String findFileFormat(final String fileAndPathName) {
return Arrays.asList(".json", ".yaml", ".yml").stream()
.filter(ext -> Files.exists(Paths.get(fileAndPathName + ext)))
.findAny()
.orElse(fileAndPathName);
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is part of the latest commit - thanks for suggesting that.
I guess this solves #1 (just to link the PR to the issue :-) ) |
Added code quality tooling and changed code accordingly