Skip to content

Conversation

@webwarrior-ws
Copy link
Contributor

@webwarrior-ws webwarrior-ws commented Jul 28, 2025

Also removed FromText property of SuggestedFix as it duplicates FromRange functionality and is not actually used anywhere.

@webwarrior-ws webwarrior-ws force-pushed the remove-suggestedfix-fromtext branch from a583792 to 3924085 Compare July 28, 2025 12:03
@webwarrior-ws webwarrior-ws reopened this Jul 28, 2025
@webwarrior-ws webwarrior-ws force-pushed the remove-suggestedfix-fromtext branch 3 times, most recently from 3c64772 to 7880339 Compare July 28, 2025 13:22
@webwarrior-ws webwarrior-ws changed the title Core(Framework,Rules): SuggestedFix refactoring Add fix command-line to apply quickfixes and unit test Jul 28, 2025
@webwarrior-ws webwarrior-ws force-pushed the remove-suggestedfix-fromtext branch 3 times, most recently from 14a265e to 27342d3 Compare July 29, 2025 08:43
@webwarrior-ws webwarrior-ws force-pushed the remove-suggestedfix-fromtext branch 2 times, most recently from df6e26c to bc9e328 Compare July 29, 2025 10:06

let handleFixResult (ruleName: string) = function
| LintResult.Success warnings ->
String.Format(Resources.GetString "ConsoleApplyingSuggestedFixFile", ruleName) |> output.WriteInfo
Copy link
Collaborator

Choose a reason for hiding this comment

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

@webwarrior-ws ruleName? this is wrong

Copy link
Contributor Author

Choose a reason for hiding this comment

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

What should the parameter be then?

Copy link
Collaborator

@knocte knocte Jul 29, 2025

Choose a reason for hiding this comment

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

Same as what happens when printing "Linting {0}", obviously

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Changed to print notification for every warning, with file name as parameter. There may be several warnings per file though.

Copy link
Collaborator

Choose a reason for hiding this comment

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

There may be several warnings per file though.

Then this was wrong, it should only print once per file. (And it was also wrong even if not adding the $0 element.)

Copy link
Collaborator

Choose a reason for hiding this comment

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

Because I guess that "Linting {0}" only gets printed once per file/project/solution?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The function is not called once per file, but once per rule.

Copy link
Collaborator

Choose a reason for hiding this comment

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

I'm not talking about what the code does now, but what the code should do. And it should do the same as Linting{0}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Changed the logic. Now it is what you meant @knocte ?

@webwarrior-ws webwarrior-ws force-pushed the remove-suggestedfix-fromtext branch 2 times, most recently from a82fe7c to 8beb004 Compare July 29, 2025 11:16
@knocte knocte changed the title Add fix command-line to apply quickfixes and unit test Add 'fix' command to apply fixes (and unit test) Jul 30, 2025
@knocte
Copy link
Collaborator

knocte commented Aug 13, 2025

@webwarrior-ws let's rebase this PR when you have time (but beware of recent push from me, to include the last commit; so git pull --rebase first please)

@webwarrior-ws webwarrior-ws force-pushed the remove-suggestedfix-fromtext branch from 2e3a715 to 918d878 Compare August 13, 2025 10:35
@knocte
Copy link
Collaborator

knocte commented Aug 13, 2025

@webwarrior-ws sorry this needs another rebase

Removed FromText property of SuggestedFix as it duplicates
FromRange functionality and is not actually used anywhere.
@webwarrior-ws webwarrior-ws force-pushed the remove-suggestedfix-fromtext branch from 7ebe1cf to 5a538ef Compare August 14, 2025 09:22
Co-authored-by: Parham Saremi <[email protected]>
Co-authored-by: webwarrior-ws <[email protected]>
@webwarrior-ws webwarrior-ws force-pushed the remove-suggestedfix-fromtext branch from 53574ca to 7a893d9 Compare August 14, 2025 09:52
It was a bit confusing that in some parts of the codebase,
the rule's fixes were called "QuickFix" sometimes (more
like towards the user) and "SuggestedFix" in others (more
API-wise). With this commit we just converge both ways into
one, and a much simpler one: fix.
@webwarrior-ws webwarrior-ws force-pushed the remove-suggestedfix-fromtext branch from 6efbad1 to 7a893d9 Compare August 14, 2025 10:10
@webwarrior-ws
Copy link
Contributor Author

@webwarrior-ws sorry this needs another rebase

Rebased

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.

3 participants