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

feat: Generate Ignore.xml #18

Conversation

workgroupengineering
Copy link
Contributor

GitHub Issue (If applicable): #

PR Type

What kind of change does this PR introduce?

  • Feature

What is the current behavior?

What is the new behavior?

Allowed to generate Ingnore.xml

PR Checklist

Please check if your PR fulfills the following requirements:

  • Tests for the changes have been added (for bug fixes / features) (if applicable)
  • Contains NO breaking changes
  • Associated with an issue (GitHub or internal)

Other information

Internal Issue (If applicable):

Part of unoplatform/uno#10885


var result = await wc.UploadStringTaskAsync(contentUri, "POST", document);

return JsonConvert.DeserializeObject(result);

Choose a reason for hiding this comment

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

dynamic seem like a worse idea, than just returning the string
but, if you arent using the result pass debugging stage
it is better to just let this be a Task of nothing


if(types.Count + properties.Count + events.Count + methods.Count + fields.Count > 0)
{
sw.WriteLine("🚨🚨**detected some breaking changes** if changes are wanted, add following line at end of `PackageDiffIgnore.xml`.🚨🚨");

Choose a reason for hiding this comment

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

the sections can be long
you might want to wrap them in <details> syntax:

like so
<details>
<summary>like so</summary>

```xml
...// note: you need to leave a empty line between <summary> and start of ```
```
</details>


namespace Uno.PackageDiff
{
internal interface IDiffWriter : IDisposable

Choose a reason for hiding this comment

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

this contract looks highly tied to xml syntax (WriteXyzStart, WriteXyzEnd), and md formatting (XyzStart that takes in an int).
it should instead accept the array of missing types, and (containing types + their missing members: properties,fields,method and events)
or anything more context-relevant

};

p.Parse(args);

IDiffWriter writer = null;
if(string.IsNullOrEmpty(outputType))

Choose a reason for hiding this comment

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

the if-else can be extracted to a separate method:

using (var writer = BuildWriter(outtype, /* github params... */))

Comment on lines +68 to +87
foreach(var type in types)
{
if(string.Equals("md", type, StringComparison.OrdinalIgnoreCase))
{
composite.Add(new Writers.MDDiffWriter(outputFile));
}
else if(string.Equals("diff", type, StringComparison.OrdinalIgnoreCase))
{
composite.Add(new Writers.XmlIngnoreWriter(outputFile));
}
else if(string.Equals("github", type, StringComparison.OrdinalIgnoreCase))
{
composite.Add(new Writers.GitHubWriter(githubPAT, sourceRepository, githubPRid));
}
}
if(composite.Count == 0)
{
Console.WriteLine($"Error : Invalid outtype {outputType}.");
return 1;
}

Choose a reason for hiding this comment

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

a combination of valid and invalid outtype will slip through here... ex: "outtype=diff,asd"

you should add a final else: else { Console.WriteLine($"Error: Invalid outtype: {type}"); }
and change the final if to composite.Count != types.Length


namespace Uno.PackageDiff.Writers
{
internal class XmlIngnoreWriter : IDiffWriter

Choose a reason for hiding this comment

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

Suggested change
internal class XmlIngnoreWriter : IDiffWriter
internal class XmlIgnoreWriter : IDiffWriter

and, the same in commit+pr title too

@workgroupengineering workgroupengineering changed the title feat: Generate Ingnore.xml feat: Generate Ignore.xml Jan 11, 2023
@workgroupengineering
Copy link
Contributor Author

Replaced by #20

@workgroupengineering workgroupengineering deleted the features/Generate_Ingnore.xml branch January 12, 2023 17:17
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.

2 participants