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

[BE2] Work on more rules for linter #1871

Merged
merged 25 commits into from
Jun 17, 2024
Merged

Conversation

t1b00
Copy link
Contributor

@t1b00 t1b00 commented May 17, 2024

Newly implemented rules:

  • IllegalFormatString
  • IncorrectNumberOfArgs
  • IncorrectlyNamedExceptions
  • LonelySealedTrait
  • MapGetAndGetOrElse
  • NanComparison
  • OptionSize
  • OptionGet
  • StripMarginOnregex
  • TryGet

Improved rules

  • EmptyInterpolatedString now supports literal.format() warning

Added Util file for utility methods (finding type, finding declarations...)

Task list: https://docs.google.com/spreadsheets/d/1LjsvOvH56TTYzyhhRpGPTqyeaSzew-pMDEPzRPVO3tE/edit?usp=sharing

@t1b00 t1b00 self-assigned this May 17, 2024
Copy link

Pull reviewers stats

Stats of the last 30 days for popstellar:

User Total reviews Time to review Total comments
K1li4nL
🥇
10
▀▀
5d 23h 55m
32
▀▀
pierluca
🥈
6
13d 6h 39m
39
▀▀
arnauds5
🥉
6
7d 5h 54m
22
Tyratox
4
14d 6h 12m
42
▀▀
simone-kalbermatter
4
1d 7h 51m
0
quadcopterman
4
5d 19h 9m
1
t1b00
3
9d 4h 55m
5
MariemBaccari
3
26d 2h 39m
▀▀
11
onsriahi14
3
18h 39m
6
matteosz
3
4d 1h 8m
5
DanielTavaresA
3
5d 13m
13
Kaz-ookid
3
14d 4h 30m
8
1florentin
2
8d 13h 48m
6
osm-alt
2
6d 22h 53m
12
ljankoschek
2
18m
0
4xiom5
1
12d 4h 52m
0
emonnin-epfl
1
25d 21h 8m
▀▀
2
⚡️ Pull request stats

t1b00 added 12 commits May 17, 2024 16:29
…nverted nested methods to private class methods)
…nverted nested methods to private class methods)
… into work-be2-thibault-linter_master

# Conflicts:
#	be2-scala/linter/input/src/main/scala/fix/LonelySealedTrait.scala
Corrected functionality in findDefinition (could previously only find literal definitions).
Adapted other rules (IncorrectNumberOfArgsToFormat, IllegalFormatString) to modification
@t1b00 t1b00 changed the title Work on more rules for linter [BE2] Work on more rules for linter May 29, 2024
t1b00 added 6 commits May 29, 2024 11:26
Adapted IllegalFormatString and NanComparison to modification in findDefinitions in Util
Improved Util with a matchType function and adapted matching
Copy link

sonarcloud bot commented May 30, 2024

Quality Gate Passed Quality Gate passed for 'PoP - Fe1-Web'

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
No data about Duplication

See analysis details on SonarCloud

@t1b00 t1b00 marked this pull request as ready for review June 3, 2024 12:21
@t1b00 t1b00 requested a review from a team as a code owner June 3, 2024 12:21
Copy link
Collaborator

@DanielTavaresA DanielTavaresA left a comment

Choose a reason for hiding this comment

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

Overall good code. Couple of comments. If I could suggest an improvement it would be to add more documentation/comment in your code. Lint code is not trivial for persons for the outside and it can be hard to understand what is being done. In particular I think having a small comment on case saying what it is matching would improve greatly readability.

Copy link

sonarcloud bot commented Jun 5, 2024

Quality Gate Passed Quality Gate passed for 'PoP - PoPCHA-Web-Client'

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
No data about Duplication

See analysis details on SonarCloud

Copy link

sonarcloud bot commented Jun 5, 2024

Quality Gate Passed Quality Gate passed for 'PoP - Be2-Scala'

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
No data about Duplication

See analysis details on SonarCloud

Copy link

sonarcloud bot commented Jun 5, 2024

Quality Gate Passed Quality Gate passed for 'PoP - Be1-Go'

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
No data about Duplication

See analysis details on SonarCloud

Copy link

sonarcloud bot commented Jun 5, 2024

Quality Gate Passed Quality Gate passed for 'PoP - Fe2-Android'

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
No data about Duplication

See analysis details on SonarCloud

@t1b00 t1b00 requested a review from DanielTavaresA June 6, 2024 19:14
Copy link
Contributor

@K1li4nL K1li4nL left a comment

Choose a reason for hiding this comment

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

Really a non-expert eye here, your code looks good to me, the tests make sense so I will trust that, good job !

Copy link
Collaborator

@DanielTavaresA DanielTavaresA left a comment

Choose a reason for hiding this comment

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

Most important comments addressed. LGTM

@t1b00 t1b00 added this pull request to the merge queue Jun 17, 2024
@t1b00 t1b00 merged commit 62b1a2e into master Jun 17, 2024
17 checks passed
@t1b00 t1b00 deleted the work-be2-thibault-linter_master branch June 17, 2024 12:12
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.

3 participants