Skip to content
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

Enable ProcedureSyntax lint rule #2651

Merged
merged 2 commits into from
Oct 3, 2020

Conversation

richardxia
Copy link
Member

Related issue:

Type of change: other enhancement

Impact: no functional change

Development Phase: implementation

Release Notes


Followup to #2648. Compared to #2650, this lint rule requires modifying a much larger number of lines of code in rocket-chip.

This PR enables the ProcedureSyntax lint rule in Scalafix. A deprecated syntax of Scala was to allow for a Java/C-style method declaration that did not require an explicit = separating the method name and type signature from the body of the method. This lint rule detects instances of that older syntax and will change them to 1) have the explicit return type of Unit and 2) to place an = between the return type and the opening curly brace of the method body.

@aswaterman
Copy link
Member

Why do we want to do this? The procedure-style syntax is unambiguous.

@richardxia
Copy link
Member Author

Why do we want to do this? The procedure-style syntax is unambiguous.

It will no longer supported in Scala 3: https://dotty.epfl.ch/docs/reference/dropped-features/procedure-syntax.html

Copy link
Member

@aswaterman aswaterman left a comment

Choose a reason for hiding this comment

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

That is certainly a valid reason.

Copy link
Member

@seldridge seldridge left a comment

Choose a reason for hiding this comment

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

Explicit return types look good to me.

@richardxia richardxia merged commit f506db0 into master Oct 3, 2020
@richardxia richardxia deleted the enable-procedure-syntax-lint-rule branch October 3, 2020 00:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants