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

Adds support for CldrJSONDataProvider for Dates (based on #256) #258

Merged
merged 2 commits into from
Sep 23, 2020

Conversation

zbraniecki
Copy link
Member

This is my WIP on the CLDRJsonDataProvider on top of #256

This is waiting for resolution in #257 and on #256, so I'm going to start it as a draft here.

@jira-pull-request-webhook
Copy link

Hooray! The files in the branch are the same across the force-push. 😃

~ Your Friendly Jira-GitHub PR Checker Bot

@zbraniecki zbraniecki mentioned this pull request Sep 20, 2020
@coveralls
Copy link

coveralls commented Sep 20, 2020

Pull Request Test Coverage Report for Build 3995b250e6517cb5e9d0754cd12e1f8b0b899761-PR-258

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • 5 unchanged lines in 1 file lost coverage.
  • Overall coverage increased (+6.3%) to 89.211%

Files with Coverage Reduction New Missed Lines %
components/locale/src/langid.rs 5 0%
Totals Coverage Status
Change from base Build ab00f54f6ce0fd898a6f8a6d70e77a24926a3dcd: 6.3%
Covered Lines: 1662
Relevant Lines: 1863

💛 - Coveralls

Copy link
Member

@sffc sffc left a comment

Choose a reason for hiding this comment

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

Nice!

@jira-pull-request-webhook
Copy link

Notice: the branch changed across the force-push!

  • components/cldr-json-data-provider/src/reader.rs is different
  • components/cldr-json-data-provider/src/transform/dates.rs is different
  • components/data-provider/src/structs/dates.rs is different

View Diff Across Force-Push

~ Your Friendly Jira-GitHub PR Checker Bot

@jira-pull-request-webhook
Copy link

Notice: the branch changed across the force-push!

  • components/cldr-json-data-provider/src/transform/dates.rs is different

View Diff Across Force-Push

~ Your Friendly Jira-GitHub PR Checker Bot

@jira-pull-request-webhook
Copy link

Notice: the branch changed across the force-push!

  • components/cldr-json-data-provider/src/transform/dates.rs is different

View Diff Across Force-Push

~ Your Friendly Jira-GitHub PR Checker Bot

@zbraniecki zbraniecki self-assigned this Sep 21, 2020
@zbraniecki zbraniecki added this to the ICU4X 0.1 milestone Sep 21, 2020
@jira-pull-request-webhook
Copy link

Notice: the branch changed across the force-push!

  • components/cldr-json-data-provider/src/reader.rs is different
  • components/cldr-json-data-provider/src/transform/dates.rs is different
  • components/cldr-json-data-provider/tests/testdata/cs-ca-gregorian.json is now changed in the branch
  • components/data-provider/src/structs/dates.rs is different

View Diff Across Force-Push

~ Your Friendly Jira-GitHub PR Checker Bot

@zbraniecki zbraniecki marked this pull request as ready for review September 21, 2020 20:47
@zbraniecki zbraniecki requested a review from a team as a code owner September 21, 2020 20:47
@zbraniecki
Copy link
Member Author

I think this patch is ready for review!

sffc
sffc previously approved these changes Sep 21, 2020
components/cldr-json-data-provider/src/transform/dates.rs Outdated Show resolved Hide resolved
components/cldr-json-data-provider/src/transform/dates.rs Outdated Show resolved Hide resolved
@sffc
Copy link
Member

sffc commented Sep 21, 2020

Also re-run cargo fmt please

@jira-pull-request-webhook
Copy link

Hooray! The files in the branch are the same across the force-push. 😃

~ Your Friendly Jira-GitHub PR Checker Bot

@jira-pull-request-webhook
Copy link

Notice: the branch changed across the force-push!

  • components/cldr-json-data-provider/src/transform/dates.rs is different
  • components/data-provider/src/structs/dates.rs is different

View Diff Across Force-Push

~ Your Friendly Jira-GitHub PR Checker Bot

@jira-pull-request-webhook
Copy link

Notice: the branch changed across the force-push!

  • components/cldr-json-data-provider/src/transform/dates.rs is different
  • components/data-provider/src/structs/dates.rs is different

View Diff Across Force-Push

~ Your Friendly Jira-GitHub PR Checker Bot

@zbraniecki zbraniecki changed the title [WIP] Adds support for CldrJSONDataProvider for Dates (based on #256) Adds support for CldrJSONDataProvider for Dates (based on #256) Sep 22, 2020
@jira-pull-request-webhook
Copy link

Hooray! The files in the branch are the same across the force-push. 😃

~ Your Friendly Jira-GitHub PR Checker Bot

@jira-pull-request-webhook
Copy link

Notice: the branch changed across the force-push!

  • components/cldr-json-data-provider/src/transform/dates.rs is different

View Diff Across Force-Push

~ Your Friendly Jira-GitHub PR Checker Bot

@jira-pull-request-webhook
Copy link

Notice: the branch changed across the force-push!

  • components/data-provider/src/data_key.rs is no longer changed in the branch
  • components/data-provider/src/structs/dates.rs is no longer changed in the branch
  • components/data-provider/src/structs/mod.rs is no longer changed in the branch
  • components/data-provider/src/structs/plurals.rs is no longer changed in the branch

View Diff Across Force-Push

~ Your Friendly Jira-GitHub PR Checker Bot

sffc
sffc previously approved these changes Sep 22, 2020
true
}
}
matches_width(&self.abbreviated, &other.abbreviated) &&
Copy link
Member

Choose a reason for hiding this comment

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

Consider:

(other.abbreviated.is_none() || Some(self.abbreviated) == other.abbreviated)

Copy link
Member Author

Choose a reason for hiding this comment

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

Applied!

.take_payload()
.unwrap();

println!("{:#?}", cs_dates);
Copy link
Member

Choose a reason for hiding this comment

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

What happens to println! in tests?

Copy link
Member Author

Choose a reason for hiding this comment

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

Removed!

@jira-pull-request-webhook
Copy link

Notice: the branch changed across the force-push!

  • components/cldr-json-data-provider/src/transform/mod.rs is different

View Diff Across Force-Push

~ Your Friendly Jira-GitHub PR Checker Bot


impl PartialEq<cldr_json::$name::StandAloneWidths> for cldr_json::$name::FormatWidths {
fn eq(&self, other: &cldr_json::$name::StandAloneWidths) -> bool {
other.abbreviated.is_none() || Some(&self.abbreviated) == other.abbreviated.as_ref() &&
Copy link
Member

Choose a reason for hiding this comment

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

I think you need some more () due to order of operations.

Can you add a test case for this behavior?

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks! I remodelled it to bring a bit more unaliasing via ability to skip widths based on if they differ in stand_alone, and added a unit test.

@jira-pull-request-webhook
Copy link

Notice: the branch changed across the force-push!

  • components/cldr-json-data-provider/src/transform/dates.rs is different

View Diff Across Force-Push

~ Your Friendly Jira-GitHub PR Checker Bot

@zbraniecki zbraniecki merged commit 97e53be into unicode-org:master Sep 23, 2020
zbraniecki added a commit that referenced this pull request Sep 23, 2020
* Add support for Dates to CLDRJsonDataProvider

* Apply feedback

* Add Dates to FsDataProviderExport
@sffc sffc linked an issue Oct 3, 2020 that may be closed by this pull request
@zbraniecki zbraniecki deleted the datetime-provider branch October 19, 2020 15:49
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.

CLDR to ICU4X-JSON Converter
3 participants