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

Code critique improvement: ReMultiplePeriodsTerminatingStatementRule does not detect multiple periods with source code comments in between #15955

Closed
jbrichau opened this issue Jan 14, 2024 · 4 comments · Fixed by #15956

Comments

@jbrichau
Copy link
Contributor

Bug description
The code critique rule ReMultiplePeriodsTerminatingStatementRule does not detect multiple periods when a source code comment is put in between the dots. Such a case is still considered an empty statement and was detected using the Grease Slime rule GREmptyStatementsRule. This rule is important for portable code to dialects where the compiler does not accept empty statements.

I am moving out all duplicate rules from Grease Slime in Pharo in an improvement effort (see SeasideSt/Grease#167). To remove the GREmptyStatementsRule, it is important that this case is detected by ReMultiplePeriodsTerminatingStatementRule

To Reproduce
Enter the following code in an editor:

emptyStatement
  self and."foo".self and

Expected behavior
The code critique for multiple periods should be shown.

Version information:

  • Pharo Version 11+
@Ducasse
Copy link
Member

Ducasse commented Jan 14, 2024

Nice catch.
BTW we should push the Slime rules that make sense in Pharo.

@jbrichau
Copy link
Contributor Author

jbrichau commented Jan 14, 2024

I made a PR to fix this issue: #15956.

@Ducasse Indeed. This is part of that effort ;-). I am moving all general rules to https://github.com/SeasideSt/PharoWithStyle/ and trying to add more.
But for that, I needed to move current Slime implementation to the Renraku critiques otherwise it became a mess.
Now I can finally move forward there

GitHub
Code style rules from the Pharo With Style book. Contribute to SeasideSt/PharoWithStyle development by creating an account on GitHub.

@Ducasse
Copy link
Member

Ducasse commented Jan 14, 2024

Excellent!!!!!

@Ducasse
Copy link
Member

Ducasse commented Jan 14, 2024

I will use the Pharo With Style for all the students :)

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 a pull request may close this issue.

2 participants