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

Resolve #260 Introduce GeneratorConfig #265

Merged
merged 11 commits into from
Sep 27, 2020
Merged

Resolve #260 Introduce GeneratorConfig #265

merged 11 commits into from
Sep 27, 2020

Conversation

tefra
Copy link
Owner

@tefra tefra commented Sep 24, 2020

Introduce a generator configuration with more options like custom naming schemes and aliases.

https://xsdata.readthedocs.io/en/issue-260/codegen.html#configuration

<?xml version='1.0' encoding='UTF-8'?>
<Config xmlns="http://pypi.org/project/xsdata" version="20.9">
  <Output wsdl="false">
    <Package>generated</Package>
    <Format>pydata</Format>
    <Structure>filenames</Structure>
  </Output>
  <Conventions>
    <ClassName case="pascalCase" safePrefix="type"/>
    <FieldName case="snakeCase" safePrefix="value"/>
    <ModuleName case="snakeCase" safePrefix="mod"/>
    <PackageName case="snakeCase" safePrefix="pkg"/>
  </Conventions>
  <Aliases>
    <ClassName source="fooType" target="Foo"/>
    <ClassName source="ABCSomething" target="ABCSomething"/>
    <FieldName source="ChangeofGauge" target="change_of_gauge"/>
    <PackageName source="http://www.w3.org/1999/xhtml" target="xtml"/>
    <ModuleName source="2010.1" target="2020a"/>
  </Aliases>
</Config>

@tefra tefra changed the title Introduce GeneratorConfig Resolve #260 Introduce GeneratorConfig Sep 24, 2020
@tefra tefra added the wip label Sep 24, 2020
@codecov
Copy link

codecov bot commented Sep 24, 2020

Codecov Report

Merging #265 into master will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##            master      #265    +/-   ##
==========================================
  Coverage   100.00%   100.00%            
==========================================
  Files           66        66            
  Lines         4819      5039   +220     
  Branches       825       862    +37     
==========================================
+ Hits          4819      5039   +220     
Impacted Files Coverage Δ
xsdata/codegen/handlers/class_extension.py 100.00% <ø> (ø)
xsdata/formats/dataclass/utils.py 100.00% <ø> (ø)
xsdata/cli.py 100.00% <100.00%> (ø)
xsdata/codegen/handlers/attribute_mismatch.py 100.00% <100.00%> (ø)
xsdata/codegen/mappers/definitions.py 100.00% <100.00%> (ø)
xsdata/codegen/mappers/schema.py 100.00% <100.00%> (ø)
xsdata/codegen/models.py 100.00% <100.00%> (ø)
xsdata/codegen/resolver.py 100.00% <100.00%> (ø)
xsdata/codegen/sanitizer.py 100.00% <100.00%> (ø)
xsdata/codegen/transformer.py 100.00% <100.00%> (ø)
... and 20 more

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 861f0b6...01ea739. Read the comment docs.

@tefra tefra force-pushed the issue-260 branch 2 times, most recently from 4853fe0 to 67baf67 Compare September 24, 2020 21:12
@tefra tefra force-pushed the issue-260 branch 2 times, most recently from e2e29c1 to 5cf00e5 Compare September 26, 2020 22:27
@tefra tefra merged commit 4758390 into master Sep 27, 2020
@tefra tefra deleted the issue-260 branch September 27, 2020 15:57
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.

1 participant