chore(editorconfig): set and apply some defaults (#974)

This commit is contained in:
EdJoPaTo 2024-02-27 12:39:37 +01:00 committed by Josh McKinney
parent 3834374652
commit 38c17e091c
No known key found for this signature in database
GPG key ID: 722287396A903BC5
13 changed files with 40 additions and 35 deletions

View file

@ -2,6 +2,12 @@
root = true root = true
[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
[*.rs] [*.rs]
indent_style = space indent_style = space
indent_size = 4 indent_size = 4

View file

@ -84,4 +84,3 @@ jobs:
echo "Pull request is labeled as 'do not merge'" echo "Pull request is labeled as 'do not merge'"
echo "This workflow fails so that the pull request cannot be merged" echo "This workflow fails so that the pull request cannot be merged"
exit 1 exit 1

View file

@ -113,6 +113,7 @@ exist to show coverage directly in your editor. E.g.:
### Documentation ### Documentation
Here are some guidelines for writing documentation in Ratatui. Here are some guidelines for writing documentation in Ratatui.
Every public API **must** be documented. Every public API **must** be documented.
Keep in mind that Ratatui tends to attract beginner Rust users that may not be familiar with Rust Keep in mind that Ratatui tends to attract beginner Rust users that may not be familiar with Rust
@ -125,10 +126,9 @@ the concepts pointing to the various methods. Focus on interaction with various
enough information that helps understand why you might want something. enough information that helps understand why you might want something.
Examples should help users understand a particular usage, not test a feature. They should be as Examples should help users understand a particular usage, not test a feature. They should be as
simple as possible. simple as possible. Prefer hiding imports and using wildcards to keep things concise. Some imports
Prefer hiding imports and using wildcards to keep things concise. Some imports may still be shown may still be shown to demonstrate a particular non-obvious import (e.g. `Stylize` trait to use style
to demonstrate a particular non-obvious import (e.g. `Stylize` trait to use style methods). methods). Speaking of `Stylize`, you should use it over the more verbose style setters:
Speaking of `Stylize`, you should use it over the more verbose style setters:
```rust ```rust
let style = Style::new().red().bold(); let style = Style::new().red().bold();

View file

@ -189,7 +189,7 @@ impl<'a> BarChart<'a> {
/// If not set, this defaults to `1`. /// If not set, this defaults to `1`.
/// The bar label also uses this value as its width. /// The bar label also uses this value as its width.
#[must_use = "method moves the value of self and returns the modified value"] #[must_use = "method moves the value of self and returns the modified value"]
pub fn bar_width(mut self, width: u16) -> BarChart<'a> { pub const fn bar_width(mut self, width: u16) -> BarChart<'a> {
self.bar_width = width; self.bar_width = width;
self self
} }