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

A new rule that finds used underscore prefixed elements #643

Merged
merged 12 commits into from
Dec 28, 2023

Conversation

webwarrior-ws
Copy link
Contributor

@webwarrior-ws webwarrior-ws commented Dec 20, 2023

Supersedes #591

Fixes #573

@knocte
Copy link
Collaborator

knocte commented Dec 20, 2023

This branch has conflicts that must be resolved

@webwarrior-ws bad rebase ^ ; also, please push 1 by 1

@knocte
Copy link
Collaborator

knocte commented Dec 21, 2023

@webwarrior-ws I think what you did wrong here when squashing is overlooking/disregarding this common pitfall about git: https://github.com/nblockchain/conventions/blob/master/docs/WorkflowGuidelines.md?plain=1#L245

@webwarrior-ws
Copy link
Contributor Author

When I rebased there were no conflicts. Then I was squashing commits and something must have gone wrong there.

@knocte
Copy link
Collaborator

knocte commented Dec 21, 2023

and something must have gone wrong there.

Exactly what I meant when I pointed to our documentation, please read this line: https://github.com/nblockchain/conventions/blob/master/docs/WorkflowGuidelines.md?plain=1#L245

@knocte
Copy link
Collaborator

knocte commented Dec 21, 2023

@webwarrior-ws shouldn't 06fb857's CI be green instead of red?

@webwarrior-ws
Copy link
Contributor Author

@webwarrior-ws shouldn't 06fb857's CI be green instead of red?

In this commit I made tests pass, but self-check fails revealing another bug. Then I added test for this case in next commit and fix in the last commit.

@knocte
Copy link
Collaborator

knocte commented Dec 21, 2023

I think the first 7 commits need to be squashed, we don't gain anything by having them split in many, and their CI statuses are all red anyway (without having a failing test).

@webwarrior-ws
Copy link
Contributor Author

Squashed first 7 commits

@knocte
Copy link
Collaborator

knocte commented Dec 26, 2023

@webwarrior-ws commits c0559b8 and 886f064 can be squashed properly too. Also don't forget to address last commit (make test pass -> CI green). Thanks

tehraninasab and others added 11 commits December 28, 2023 11:44
Add new rule: UsedUnderscorePrefixedElements.
Avoid using mutable variables. Fix match indentation. Remove
unnecessary parens. Rename function.
Added failing tests for UsedUnderscorePrefixedElements rule.
Fix rule so that it identifies all usages of identifiers that
start with `_`.
Activated inactive tests for UsedUnderscorePrefixedElements and
added a new one.
Fix rule so that it doesn't produce error on `_` function arguments.
Removed unused function in UsedUnderscorePrefixedElements rule.
@knocte knocte force-pushed the find-used-_elements branch from 2821987 to 5b6306f Compare December 28, 2023 04:13
@knocte
Copy link
Collaborator

knocte commented Dec 28, 2023

@webwarrior-ws please note: as the quickfix commits (the last three) require more discussion, I've removed them from this PR. So, once I merge it, you can create new PR for those commits (e.g. cherry-picking them from this backup branch where I pushed them: https://github.com/knocte/FSharpLint/commits/addQuickFixToRule82/ ).

@knocte knocte merged commit 57e4bf0 into fsprojects:master Dec 28, 2023
5 checks passed
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.

Rule to find used _elements
3 participants