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
[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
[*.rs]
indent_style = space
indent_size = 4

View file

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

View file

@ -113,6 +113,7 @@ exist to show coverage directly in your editor. E.g.:
### Documentation
Here are some guidelines for writing documentation in Ratatui.
Every public API **must** be documented.
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.
Examples should help users understand a particular usage, not test a feature. They should be as
simple as possible.
Prefer hiding imports and using wildcards to keep things concise. Some imports may still be shown
to demonstrate a particular non-obvious import (e.g. `Stylize` trait to use style methods).
Speaking of `Stylize`, you should use it over the more verbose style setters:
simple as possible. Prefer hiding imports and using wildcards to keep things concise. Some imports
may still be shown to demonstrate a particular non-obvious import (e.g. `Stylize` trait to use style
methods). Speaking of `Stylize`, you should use it over the more verbose style setters:
```rust
let style = Style::new().red().bold();

View file

@ -189,7 +189,7 @@ impl<'a> BarChart<'a> {
/// If not set, this defaults to `1`.
/// The bar label also uses this value as its width.
#[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
}