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

Support format json5 #142

Closed
wants to merge 4 commits into from
Closed

Support format json5 #142

wants to merge 4 commits into from

Conversation

up9cloud
Copy link
Contributor

@up9cloud up9cloud commented Jul 6, 2020

😄

Copy link
Member

@matthiasbeyer matthiasbeyer left a comment

Choose a reason for hiding this comment

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

There seem to be some more unnecessary scopes I did not comment.

Also, the diff includes code format changes which have nothing to do with this PR, which should be filed in another PR (or which are already filed in #155).

examples/glob/src/main.rs Outdated Show resolved Hide resolved
examples/glob/src/main.rs Outdated Show resolved Hide resolved
examples/glob/src/main.rs Outdated Show resolved Hide resolved
examples/glob/src/main.rs Outdated Show resolved Hide resolved
examples/glob/src/main.rs Outdated Show resolved Hide resolved
examples/glob/src/main.rs Outdated Show resolved Hide resolved
src/file/format/hjson.rs Outdated Show resolved Hide resolved
src/file/format/json.rs Outdated Show resolved Hide resolved
src/file/format/json.rs Outdated Show resolved Hide resolved
@matthiasbeyer
Copy link
Member

Are you still interested in this?

If yes, I created a maintenance fork (read here).
Feel free to submit your patches! 😄

@up9cloud up9cloud requested a review from matthiasbeyer April 17, 2021 07:12
Copy link
Member

@matthiasbeyer matthiasbeyer left a comment

Choose a reason for hiding this comment

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

So, I did a review of all changes in this PR.

Overall I have to say that this goes into the right direction, I guess. Still, I have quite a few remarks.

In general: Could you please rebase to master? This way the merge commits would vanish, which is particularly important to me, as it cleans the history quite a bit. This PR is based on a really old commit and I guess some of my remarks here only exist because of the merge, which makes this diff here appear to have changes which are made on master and not in this PR. I hope. If they are indeed from this PR, please make sure to file changes that do not conceptionally belong to the json5 feature in seperate PRs. But I'd bet, as said, that most of my remarks render invalid after your rebase! 👍

Also, please make clippy happy! 😆

README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
examples/glob/conf/00-default.toml Outdated Show resolved Hide resolved
examples/glob/conf/01.json Outdated Show resolved Hide resolved
examples/glob/conf/02.yaml Outdated Show resolved Hide resolved
src/file/format/yaml.rs Outdated Show resolved Hide resolved
src/ser.rs Outdated Show resolved Hide resolved
tests/errors.rs Outdated Show resolved Hide resolved
tests/errors.rs Outdated Show resolved Hide resolved
tests/file_toml.rs Outdated Show resolved Hide resolved
@up9cloud
Copy link
Contributor Author

Remove all nonrelative files, enjoy 😄

@up9cloud up9cloud requested a review from matthiasbeyer April 17, 2021 15:40
@matthiasbeyer
Copy link
Member

Nice. Now please make it run successfully through CI, then I'll do another review.

@up9cloud
Copy link
Contributor Author

Nice. Now please make it run successfully through CI, then I'll do another review.

All green now, :)

@matthiasbeyer matthiasbeyer added this to the 0.12.0 milestone Apr 20, 2021
@@ -95,6 +95,18 @@ impl ConfigError {
}
}

// Have a proper error fire if the root of a file is ever not a Table
// TODO: for now only json5 checked, need to finish others
Copy link
Member

Choose a reason for hiding this comment

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

Is this something that needs to be done but slipped? 😆

Copy link
Contributor Author

Choose a reason for hiding this comment

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

}

Value::new(uri, ValueKind::Table(m))
}
Copy link
Member

@matthiasbeyer matthiasbeyer May 8, 2021

Choose a reason for hiding this comment

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

No, they are not. In the current version, you're iterating over a (ref to key, ref to value) tuple and then clone() the key when inserting into the hashmap.

In my version, you would iterate over the values and move them, no cloning involved.

Copy link
Contributor Author

@up9cloud up9cloud left a comment

Choose a reason for hiding this comment

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

clone() removed. enjoy :)

@up9cloud up9cloud requested a review from matthiasbeyer May 8, 2021 23:01
@matthiasbeyer
Copy link
Member

Nice. But no need to merge master, please remove that, it makes review really hard.

@up9cloud
Copy link
Contributor Author

up9cloud commented May 9, 2021

@matthiasbeyer I guess what you meant is rebase, not remove.

I have to choose merge or rebase, otherwise it won't pass CI testing.

I pushed the rebase version. enjoy.

@matthiasbeyer matthiasbeyer mentioned this pull request May 15, 2021
@matthiasbeyer
Copy link
Member

Thanks for your contribution! json5 support was merged in #206

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