-
Notifications
You must be signed in to change notification settings - Fork 112
refactor: replace Nett with Tomlyn
#230
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
Conversation
| [SuppressMessage("StyleCop.CSharp.NamingRules", "SA1300:ElementMustBeginWithUpperCaseLetter", Justification = "Deserialization contract. Casing cannot be overwritten.")] | ||
| public PoetrySource source { get; set; } | ||
|
|
||
| public TomlTable dependencies { get; set; } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Had to add this property because tomlyn wouldn't create the model if the property didn't exist and their "TomlModelOptions.IgnoreMissingProperties" didnt work in this scenario
Nett with Tomlyn
src/Microsoft.ComponentDetection.Detectors/poetry/Contracts/PoetryPackage.cs
Outdated
Show resolved
Hide resolved
src/Microsoft.ComponentDetection.Detectors/poetry/Contracts/PoetryLock.cs
Outdated
Show resolved
Hide resolved
|
|
||
| public TomlTable dependencies { get; set; } | ||
|
|
||
| public TomlTable extras { get; set; } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This needs a [DataMember(Name = "extras")] attribute.
| public TomlTable extras { get; set; } | |
| [DataMember(Name = "extras")] | |
| public TomlTable Extras { get; set; } |
src/Microsoft.ComponentDetection.Detectors/rust/Contracts/CargoLock.cs
Outdated
Show resolved
Hide resolved
src/Microsoft.ComponentDetection.Detectors/rust/RustCrateUtilities.cs
Outdated
Show resolved
Hide resolved
|
👋 Hi! It looks like you modified some files in the
If none of the above scenarios apply, feel free to ignore this comment 🙂 |
JamieMagee
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you:
- Resolve the build warnings
- Manually run this against some of our test cases in the repo and check it works okay
src/Microsoft.ComponentDetection.Detectors/rust/Contracts/CargoLock.cs
Outdated
Show resolved
Hide resolved
src/Microsoft.ComponentDetection.Detectors/poetry/Contracts/PoetryPackage.cs
Outdated
Show resolved
Hide resolved
docs/running-verification-tests.md
Outdated
|
|
||
|
|
||
| ## Step 4: Run The tests | ||
| Run or Debug the tests in test explorer like you would any other test. No newline at end of file |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add or run dotnet test from /Verification test folder from commandLine to execute them
|
|
||
| namespace Microsoft.ComponentDetection.Detectors.Poetry | ||
| { | ||
| using System.IO; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shift these 2 using statements outside of namespace alogn with other using statements.
|
|
||
| namespace Microsoft.ComponentDetection.Detectors.Rust.Contracts | ||
| { | ||
| using System.Collections.Generic; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pout these statements outside of namespace at class level.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would apply "Convert to file-scoped namespace" at the same time, too. Also, remove unneccessary directives.
Resolved the suggestions, but Jamie is not here to approve
PR for Issue #184