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

Use different method to ignore feature-dependent doctests #1534

Merged
merged 4 commits into from
Mar 22, 2024

Conversation

pitdicker
Copy link
Collaborator

@pitdicker pitdicker commented Mar 21, 2024

This will enable an almost clean run with cargo +nightly fmt -- --config format_code_in_doc_comments=true.
It did not handle a combination of doc comments and #[cfg_attr(feature = ..., doc = "...")] well.

Copy link

codecov bot commented Mar 21, 2024

Codecov Report

Attention: Patch coverage is 97.43590% with 1 lines in your changes are missing coverage. Please review.

Project coverage is 91.82%. Comparing base (18328a8) to head (206c410).

Files Patch % Lines
src/format/parsed.rs 75.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1534      +/-   ##
==========================================
+ Coverage   91.81%   91.82%   +0.01%     
==========================================
  Files          40       40              
  Lines       18319    18345      +26     
==========================================
+ Hits        16820    16846      +26     
  Misses       1499     1499              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@pitdicker pitdicker changed the title Use different method to run feature-dependent doctests Use different method to ignore feature-dependent doctests Mar 21, 2024
Copy link
Contributor

@djc djc left a comment

Choose a reason for hiding this comment

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

Nice!

@@ -279,6 +278,7 @@ impl<'a> StrftimeItems<'a> {
/// assert_eq!(fmtr.to_string(), "2023년 07월 11일");
/// let fmtr = dt.format_with_items(StrftimeItems::new_with_locale("%x", Locale::ja_JP));
/// assert_eq!(fmtr.to_string(), "2023年07月11日");
/// # }
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't see a matching opening brace...

#[cfg_attr(not(any(feature = "alloc", feature = "std")), doc = "```ignore")]
#[cfg_attr(any(feature = "alloc", feature = "std"), doc = "```rust")]
/// ```
/// # #[cfg(feature = "alloc")] {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

It is up here.

@pitdicker pitdicker merged commit 1e8df65 into chronotope:main Mar 22, 2024
35 checks passed
@pitdicker pitdicker deleted the feature_doctests branch March 22, 2024 09:39
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.

None yet

2 participants