Skip to content

Use different method to ignore feature-dependent doctests#1534

Merged
pitdicker merged 4 commits intochronotope:mainfrom
pitdicker:feature_doctests
Mar 22, 2024
Merged

Use different method to ignore feature-dependent doctests#1534
pitdicker merged 4 commits intochronotope:mainfrom
pitdicker:feature_doctests

Conversation

@pitdicker
Copy link
Copy Markdown
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.

@codecov
Copy link
Copy Markdown

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
Copy Markdown
Member

@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!

Comment thread src/format/strftime.rs
/// 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
Copy Markdown
Member

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...

Comment thread src/format/strftime.rs
#[cfg_attr(not(any(feature = "alloc", feature = "std")), doc = "```ignore")]
#[cfg_attr(any(feature = "alloc", feature = "std"), doc = "```rust")]
/// ```
/// # #[cfg(feature = "alloc")] {
Copy link
Copy Markdown
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
@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.

2 participants