Skip to content

Commit

Permalink
Sort JSON filter
Browse files Browse the repository at this point in the history
  • Loading branch information
Tina-otoge committed Jul 21, 2024
1 parent 512b811 commit b1f8645
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 25 deletions.
48 changes: 24 additions & 24 deletions examples/04-data/output/output.json
Original file line number Diff line number Diff line change
@@ -1,33 +1,14 @@
{
"markdown": "examples/04-data/input/data/markdown.md",
"yaml": {
"type": "YAML",
"data": [
{
"name": "John Doe",
"age": 30,
"student": false
},
{
"name": "Jane Doe",
"age": 25,
"date": "2021-12-31",
"norway": false
}
]
},
"json": {
"type": "json",
"data": {
"name": "John",
"age": 30,
"city": "New York",
"isStudent": false
}
},
"yaml-long-extension": {
"type": "YAML"
"isStudent": false,
"name": "John"
},
"type": "json"
},
"markdown": "<p>This is <em>markdown</em> <ins>content</ins>.</p>",
"sub1": {
"hey": {
"location": 1
Expand All @@ -37,5 +18,24 @@
"hey": {
"location": 2
}
},
"yaml": {
"data": [
{
"age": 30,
"name": "John Doe",
"student": false
},
{
"age": 25,
"date": "2021-12-31",
"name": "Jane Doe",
"norway": false
}
],
"type": "YAML"
},
"yaml-long-extension": {
"type": "YAML"
}
}
2 changes: 1 addition & 1 deletion src/sssimp/generators/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ def prepare():
def get(path: str, flat=False):
path = Path(path)
data = Data(base_path=path)
for file in path.rglob("*.*"):
for file in sorted(path.rglob("*.*")):
logging.info(f"Handling data file {file}")
data.handle_file(file)
if flat:
Expand Down

0 comments on commit b1f8645

Please sign in to comment.