Skip to content

[FLINK-7190] Activate checkstyle flink-java/* #4343

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

Closed
wants to merge 3 commits into from

Conversation

dawidwys
Copy link
Contributor

Thanks for contributing to Apache Flink. Before you open your pull request, please take the following check list into consideration.
If your changes take all of the items into account, feel free to open your pull request. For more information and/or questions please refer to the How To Contribute guide.
In addition to going through the list, please provide a meaningful description of your changes.

  • General

    • The pull request references the related JIRA issue ("[FLINK-XXX] Jira title text")
    • The pull request addresses only one issue
    • Each commit in the PR has a meaningful commit message (including the JIRA id)
  • Documentation

    • Documentation has been added for new functionality
    • Old documentation affected by the pull request has been updated
    • JavaDoc for public methods has been added
  • Tests & Build

    • Functionality added by the pull request is covered by tests
    • mvn clean verify has been executed successfully locally or a Travis build has passed

@dawidwys
Copy link
Contributor Author

This is the last commit of series. It enables the stricter checkstyle. So should be merged last.

@greghogan
Copy link
Contributor

What if we first split the suppressions files as with suppressions-runtime.xml? I think we could do this in one ticket for all of core, java, and optimizer.

@zentol
Copy link
Contributor

zentol commented Jul 14, 2017

@greghogan I agree, expanding the suppression files would be nice.

checks="NewlineAtEndOfFile|RegexpSingleline|TodoComment|RedundantImport|ImportOrder|RedundantModifier|JavadocMethod|JavadocParagraph|JavadocType|JavadocStyle|PackageName|TypeNameCheck|ConstantNameCheck|StaticVariableNameCheck|MemberNameCheck|MethodNameCheck|ParameterName|LocalFinalVariableName|LocalVariableName|LeftCurly|UpperEll|FallThrough|reliefPattern|SimplifyBooleanExpression|EmptyStatement|ModifierOrder|EmptyLineSeparator|WhitespaceAround|WhitespaceAfter|NoWhitespaceAfter|NoWhitespaceBefore|OperatorWrap|ParenPad"/>
files="ExecutionEnvironment\.java"
checks="JavadocParagraph"/>
<suppress
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why are these excluded?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In NestedMethodAnalyzer:358-362, there is an intentional fall through which I would require a bit bigger refactoring to eliminate.

For the ExecutionEnvironment it was because we linked in javadoc to class from a package that flink-java does not depend on. I've checked the generated docs, and the links do not work nevertheless, so I removed the suppression and changed {@link to {@code.

@zentol
Copy link
Contributor

zentol commented Jul 19, 2017

The switch statements can be modified to be checkstyle compliant with few changes.
NestedMethodAnalyzer#naryOperation:

...
case INVOKESTATIC:
case INVOKESPECIAL:
case INVOKEVIRTUAL:
case INVOKEINTERFACE:
	isStatic = insn.getOpCoed() == INVOKESTATIC;
...

NestedMethodAnalyzer#copyOperation:

...
case DUP2_X2:
	if (isTagged(value) && tagged(value).isInput() && tagged(value).isCallByValue()) {
		return tagged(value).copy();
	} else {
		return super.copyOperation(insn, value);
	}
...

@zentol
Copy link
Contributor

zentol commented Jul 25, 2017

merging.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants