Skip to content

Commit

Permalink
pycodegen: return a plain dictionary from save()
Browse files Browse the repository at this point in the history
  • Loading branch information
mr-c committed Sep 17, 2021
1 parent 776fdb4 commit 54458a4
Show file tree
Hide file tree
Showing 5 changed files with 171 additions and 115 deletions.
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -86,10 +86,10 @@ remove_unused_imports: $(filter-out schema_salad/metaschema.py,$(PYSOURCES))

pep257: pydocstyle
## pydocstyle : check Python code style
pydocstyle: $(PYSOURCES)
pydocstyle: $(filter-out schema_salad/metaschema.py,$(PYSOURCES))
pydocstyle --add-ignore=D100,D101,D102,D103 $^ || true

pydocstyle_report.txt: $(PYSOURCES)
pydocstyle_report.txt: $(filter-out schema_salad/metaschema.py,$(PYSOURCES))
pydocstyle setup.py $^ > $@ 2>&1 || true

diff_pydocstyle_report: pydocstyle_report.txt
Expand Down
3 changes: 3 additions & 0 deletions schema_salad/codegen_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ class TypeDef: # pylint: disable=too-few-public-methods
"ref_scope",
"loader_type",
"instance_type",
"abstract",
]

# switch to class-style typing.NamedTuple once support for Python < 3.6
Expand All @@ -27,12 +28,14 @@ def __init__(
ref_scope: Optional[int] = 0,
loader_type: Optional[str] = None,
instance_type: Optional[str] = None,
abstract: bool = False,
) -> None:
self.name = name
self.init = init
self.is_uri = is_uri
self.scoped_id = scoped_id
self.ref_scope = ref_scope
self.abstract = abstract
# Follow attributes used by Java but not Python.
self.loader_type = loader_type
self.instance_type = instance_type
Expand Down
Loading

0 comments on commit 54458a4

Please sign in to comment.