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

JsonSerializerOptions analyzer #4

Merged
merged 11 commits into from
Sep 27, 2023
Merged

JsonSerializerOptions analyzer #4

merged 11 commits into from
Sep 27, 2023

Conversation

dawedawe
Copy link
Contributor

  • add a JsonSerializerOptions analyzer
  • refactor testing code
  • add tests for new analyzer

- refactor testing code
- add tests for new analyzer
@dawedawe dawedawe requested a review from nojaf September 20, 2023 14:23
Copy link
Contributor

@nojaf nojaf left a comment

Choose a reason for hiding this comment

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

Good stuff here, happy about the progress!

module JsonSerializerOptionsAnalyzer =

[<Literal>]
let Code = "GRA-002"
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this code thing is going to be a lot of fun.

src/FSharp.Analyzers/JsonSerializerOptionsAnalyzer.fs Outdated Show resolved Hide resolved

match ctx.TypedTree with
| None -> ()
| Some typedTree -> typedTree.Declarations |> List.iter (visitDeclaration handler)
Copy link
Contributor

Choose a reason for hiding this comment

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

It seems like we have a different take on how we find the information.
In the String analyzers, I went with checking the untyped tree first in order to find invocations. I wonder what the most beneficial way is of doing things.
I genuinely do not know what is best in this case.
Let's discuss this tomorrow maybe.

@dawedawe
Copy link
Contributor Author

good to go in now

Copy link
Contributor

@nojaf nojaf left a comment

Choose a reason for hiding this comment

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

Great work!

@dawedawe dawedawe merged commit 53050e5 into main Sep 27, 2023
1 check passed
@dawedawe dawedawe deleted the add_jsonoptionsanalyzer branch September 27, 2023 13:30
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