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

Added option to prevent Prefix being added to output path #301

Closed
wants to merge 1 commit into from
Closed

Added option to prevent Prefix being added to output path #301

wants to merge 1 commit into from

Conversation

MrMikeJJ
Copy link
Contributor

Pull request for #300

@codecov
Copy link

codecov bot commented Jan 27, 2022

Codecov Report

Merging #301 (732c176) into master (668d3f7) will decrease coverage by 0.28%.
The diff coverage is 37.50%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #301      +/-   ##
==========================================
- Coverage   95.67%   95.39%   -0.29%     
==========================================
  Files          19       19              
  Lines        3310     3324      +14     
  Branches      484      486       +2     
==========================================
+ Hits         3167     3171       +4     
- Misses         82       90       +8     
- Partials       61       63       +2     
Impacted Files Coverage Δ
XmlSchemaClassGenerator/Generator.cs 86.42% <0.00%> (-1.26%) ⬇️
XmlSchemaClassGenerator/FileOutputWriter.cs 79.71% <33.33%> (-10.13%) ⬇️
XmlSchemaClassGenerator/GeneratorConfiguration.cs 95.29% <100.00%> (+0.11%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 668d3f7...732c176. Read the comment docs.

@MrMikeJJ
Copy link
Contributor Author

thinking about it, using String.Replace could cause problems if a short Prefix was used. A substring would be better. I will update if this Pull Request is something you would consider.

@@ -87,6 +88,7 @@ static void Main(string[] args)
{ "r|order", "emit order for all class members stored as XML element", v => emitOrder = v != null },
{ "c|pcl", "PCL compatible output", v => pclCompatible = v != null },
{ "p|prefix=", "the {PREFIX} to prepend to auto-generated namespace names", v => namespacePrefix = v },
{ "po|prefixOnOutput", "include the prefix on the path (default is enabled)", v => addPrefixToOutputPath = v != null },
Copy link
Owner

Choose a reason for hiding this comment

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

IMO the phrasing can be improved here. Perhaps: "po|prefixPath", "include namespace prefix in output paths (default is enabled)"

@mganss
Copy link
Owner

mganss commented Jan 28, 2022

Thank you for this PR.

If you use Substring()/range you also need to make sure that the string actually starts with the prefix. The prefix is only used for autogenerated namespaces, not explicit namespaces.

Please also add unit tests.

@MrMikeJJ
Copy link
Contributor Author

MrMikeJJ commented Jan 30, 2022

The prefix is only used for autogenerated namespaces, not explicit namespaces.

Yes, this causes issues because of that so will close this. I am getting different results running the original version through a library vs the exe. Currently investigating. (when ran through via the exe it always seems to get added).

@MrMikeJJ MrMikeJJ closed this Jan 30, 2022
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