Skip to content

Commit 4809747

Browse files
authored
Check for typos on CI (#2918)
* Check for typos on CI * Fix all typos
1 parent 77df9cb commit 4809747

22 files changed

+60
-33
lines changed

.github/workflows/typos.yml

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# https://github.com/crate-ci/typos
2+
# Add exceptions to _typos.toml
3+
# install and run locally: cargo install typos-cli && typos
4+
5+
name: Spell Check
6+
on: [pull_request]
7+
8+
jobs:
9+
run:
10+
name: Spell Check
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Checkout Actions Repository
14+
uses: actions/checkout@v2
15+
16+
- name: Check spelling of entire workspace
17+
uses: crate-ci/typos@master

CHANGELOG.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -390,7 +390,7 @@ NOTE: [`epaint`](crates/epaint/CHANGELOG.md), [`eframe`](crates/eframe/CHANGELOG
390390
* `Fonts::layout_job`: New text layout engine allowing mixing fonts, colors and styles, with underlining and strikethrough.
391391
* Added `ui.add_enabled(bool, widget)` to easily add a possibly disabled widget.
392392
* Added `ui.add_enabled_ui(bool, |ui| …)` to create a possibly disabled UI section.
393-
* Added feature `"serialize"` separatedly from `"persistence"`.
393+
* Added feature `"serialize"` separately from `"persistence"`.
394394
* Added `egui::widgets::global_dark_light_mode_buttons` to easily add buttons for switching the egui theme.
395395
* `TextEdit` can now be used to show text which can be selected and copied, but not edited.
396396
* Added `Memory::caches` for caching things from one frame to the next.
@@ -405,7 +405,7 @@ NOTE: [`epaint`](crates/epaint/CHANGELOG.md), [`eframe`](crates/eframe/CHANGELOG
405405
* MSRV (Minimum Supported Rust Version) is now `1.54.0`.
406406
* By default, `DragValue`s no longer show a tooltip when hovered. Change with `Style::explanation_tooltips`.
407407
* Smaller and nicer color picker.
408-
* `ScrollArea` will auto-shrink to content size unless told otherwise using `ScollArea::auto_shrink`.
408+
* `ScrollArea` will auto-shrink to content size unless told otherwise using `ScrollArea::auto_shrink`.
409409
* By default, `Slider`'s `clamp_to_range` is set to true.
410410
* Renamed `TextEdit::enabled` to `TextEdit::interactive`.
411411
* `ui.label` (and friends) now take `impl ToString` as argument instead of `impl Into<Label>`.
@@ -597,8 +597,8 @@ NOTE: [`epaint`](crates/epaint/CHANGELOG.md), [`eframe`](crates/eframe/CHANGELOG
597597
* Fixed bug that would close a popup (e.g. the color picker) when clicking inside of it.
598598

599599
### Deprecated ☢️
600-
* Deprectated `combo_box_with_label` in favor of new `ComboBox`.
601-
* Deprectated type-specific constructors for `Slider` and `DragValue` (`Slider::f32`, `DragValue::usize` etc).
600+
* Deprecated `combo_box_with_label` in favor of new `ComboBox`.
601+
* Deprecated type-specific constructors for `Slider` and `DragValue` (`Slider::f32`, `DragValue::usize` etc).
602602

603603

604604
## 0.10.0 - 2021-02-28 - Plot and polish
@@ -686,7 +686,7 @@ NOTE: [`epaint`](crates/epaint/CHANGELOG.md), [`eframe`](crates/eframe/CHANGELOG
686686

687687
### Changed 🔧
688688
* Renamed `Srgba` to `Color32`.
689-
* All color contructions now starts with `from_`, e.g. `Color32::from_rgb`.
689+
* All color constructors now starts with `from_`, e.g. `Color32::from_rgb`.
690690
* Renamed `FontFamily::VariableWidth` to `FontFamily::Proportional`.
691691
* Removed `pixels_per_point` from `FontDefinitions`.
692692

Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ members = [
2020
# opt-level = 's' # 10-20% smaller wasm compared to `opt-level = 3`
2121
# opt-level = 1 # very slow and big wasm. Don't do this.
2222
opt-level = 2 # fast and small wasm, basically same as `opt-level = 's'`
23-
# opt-level = 3 # unecessarily large wasm for no performance gain
23+
# opt-level = 3 # unnecessarily large wasm for no performance gain
2424

2525
# debug = true # include debug symbols, useful when profiling wasm
2626

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,7 @@ You can also call the layout code twice (once to get the size, once to do the in
286286
For "atomic" widgets (e.g. a button) `egui` knows the size before showing it, so centering buttons, labels etc is possible in `egui` without any special workarounds.
287287

288288
#### CPU usage
289-
Since an immediate mode GUI does a full layout each frame, the layout code needs to be quick. If you have a very complex GUI this can tax the CPU. In particular, having a very large UI in a scroll area (with very long scrollback) can be slow, as the content needs to be layed out each frame.
289+
Since an immediate mode GUI does a full layout each frame, the layout code needs to be quick. If you have a very complex GUI this can tax the CPU. In particular, having a very large UI in a scroll area (with very long scrollback) can be slow, as the content needs to be laid out each frame.
290290

291291
If you design the GUI with this in mind and refrain from huge scroll areas (or only lay out the part that is in view) then the performance hit is generally pretty small. For most cases you can expect `egui` to take up 1-2 ms per frame, but `egui` still has a lot of room for optimization (it's not something I've focused on yet). You can also set up `egui` to only repaint when there is interaction (e.g. mouse movement).
292292

_typos.toml

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# https://github.com/crate-ci/typos
2+
# install: cargo install typos-cli
3+
# run: typos
4+
5+
[default.extend-words]
6+
nknown = "nknown" # part of @55nknown username
7+
Prefence = "Prefence" # typo in glutin_winit API
8+
9+
[files]
10+
extend-exclude = ["docs/egui_demo_app.js"] # auto-generated

crates/eframe/src/native/epi_integration.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -522,7 +522,7 @@ impl EpiIntegration {
522522
}
523523

524524
// ------------------------------------------------------------------------
525-
// Persistance stuff:
525+
// Persistence stuff:
526526

527527
pub fn maybe_autosave(&mut self, app: &mut dyn epi::App, window: &winit::window::Window) {
528528
let now = std::time::Instant::now();

crates/eframe/src/web/backend.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -291,11 +291,11 @@ impl AppRunner {
291291
/// Get mutable access to the concrete [`App`] we enclose.
292292
///
293293
/// This will panic if your app does not implement [`App::as_any_mut`].
294-
pub fn app_mut<ConreteApp: 'static + App>(&mut self) -> &mut ConreteApp {
294+
pub fn app_mut<ConcreteApp: 'static + App>(&mut self) -> &mut ConcreteApp {
295295
self.app
296296
.as_any_mut()
297297
.expect("Your app must implement `as_any_mut`, but it doesn't")
298-
.downcast_mut::<ConreteApp>()
298+
.downcast_mut::<ConcreteApp>()
299299
.unwrap()
300300
}
301301

crates/egui/src/containers/combo_box.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ use epaint::Shape;
22

33
use crate::{style::WidgetVisuals, *};
44

5-
/// Indicate wether or not a popup will be shown above or below the box.
5+
/// Indicate whether or not a popup will be shown above or below the box.
66
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
77
pub enum AboveOrBelow {
88
Above,

crates/egui/src/grid.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,7 @@ impl GridLayout {
257257

258258
/// A simple grid layout.
259259
///
260-
/// The cells are always layed out left to right, top-down.
260+
/// The cells are always laid out left to right, top-down.
261261
/// The contents of each cell will be aligned to the left and center.
262262
///
263263
/// If you want to add multiple widgets to a cell you need to group them with

crates/egui/src/painter.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -423,7 +423,7 @@ impl Painter {
423423
self.fonts(|f| f.layout(text, font_id, color, f32::INFINITY))
424424
}
425425

426-
/// Paint text that has already been layed out in a [`Galley`].
426+
/// Paint text that has already been laid out in a [`Galley`].
427427
///
428428
/// You can create the [`Galley`] with [`Self::layout`].
429429
///
@@ -435,7 +435,7 @@ impl Painter {
435435
}
436436
}
437437

438-
/// Paint text that has already been layed out in a [`Galley`].
438+
/// Paint text that has already been laid out in a [`Galley`].
439439
///
440440
/// You can create the [`Galley`] with [`Self::layout`].
441441
///

crates/egui/src/style.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -508,7 +508,7 @@ pub struct Visuals {
508508
/// Draw a vertical lien left of indented region, in e.g. [`crate::CollapsingHeader`].
509509
pub indent_has_left_vline: bool,
510510

511-
/// Wether or not Grids and Tables should be striped by default
511+
/// Whether or not Grids and Tables should be striped by default
512512
/// (have alternating rows differently colored).
513513
pub striped: bool,
514514

crates/egui/src/ui.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -424,7 +424,7 @@ impl Ui {
424424
/// # Sizes etc
425425
impl Ui {
426426
/// Where and how large the [`Ui`] is already.
427-
/// All widgets that have been added ot this [`Ui`] fits within this rectangle.
427+
/// All widgets that have been added to this [`Ui`] fits within this rectangle.
428428
///
429429
/// No matter what, the final Ui will be at least this large.
430430
///

crates/egui/src/widget_text.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -344,7 +344,7 @@ impl RichText {
344344
/// Often a [`WidgetText`] is just a simple [`String`],
345345
/// but it can be a [`RichText`] (text with color, style, etc),
346346
/// a [`LayoutJob`] (for when you want full control of how the text looks)
347-
/// or text that has already been layed out in a [`Galley`].
347+
/// or text that has already been laid out in a [`Galley`].
348348
#[derive(Clone)]
349349
pub enum WidgetText {
350350
RichText(RichText),
@@ -662,21 +662,21 @@ impl WidgetTextJob {
662662

663663
// ----------------------------------------------------------------------------
664664

665-
/// Text that has been layed out and ready to be painted.
665+
/// Text that has been laid out and ready to be painted.
666666
#[derive(Clone, PartialEq)]
667667
pub struct WidgetTextGalley {
668668
pub galley: Arc<Galley>,
669669
pub galley_has_color: bool,
670670
}
671671

672672
impl WidgetTextGalley {
673-
/// Size of the layed out text.
673+
/// Size of the laid out text.
674674
#[inline]
675675
pub fn size(&self) -> crate::Vec2 {
676676
self.galley.size()
677677
}
678678

679-
/// Size of the layed out text.
679+
/// Size of the laid out text.
680680
#[inline]
681681
pub fn text(&self) -> &str {
682682
self.galley.text()

crates/egui_demo_lib/src/demo/about.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ fn about_immediate_mode(ui: &mut egui::Ui) {
6969
ui.label("Note how there are no callbacks or messages, and no button state to store.");
7070

7171
ui.label("Immediate mode has its roots in gaming, where everything on the screen is painted at the display refresh rate, i.e. at 60+ frames per second. \
72-
In immediate mode GUIs, the entire interface is layed out and painted at the same high rate. \
72+
In immediate mode GUIs, the entire interface is laid out and painted at the same high rate. \
7373
This makes immediate mode GUIs especially well suited for highly interactive applications.");
7474

7575
ui.horizontal_wrapped(|ui| {

crates/egui_demo_lib/src/demo/scrolling.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ impl super::View for Scrolling {
8686

8787
fn huge_content_lines(ui: &mut egui::Ui) {
8888
ui.label(
89-
"A lot of rows, but only the visible ones are layed out, so performance is still good:",
89+
"A lot of rows, but only the visible ones are laid out, so performance is still good:",
9090
);
9191
ui.add_space(4.0);
9292

crates/egui_demo_lib/src/demo/table_demo.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#[cfg_attr(feature = "serde", derive(serde::Deserialize, serde::Serialize))]
33
enum DemoType {
44
Manual,
5-
ManyHomogenous,
5+
ManyHomogeneous,
66
ManyHeterogenous,
77
}
88

@@ -61,7 +61,7 @@ impl super::View for TableDemo {
6161
ui.radio_value(&mut self.demo, DemoType::Manual, "Few, manual rows");
6262
ui.radio_value(
6363
&mut self.demo,
64-
DemoType::ManyHomogenous,
64+
DemoType::ManyHomogeneous,
6565
"Thousands of rows of same height",
6666
);
6767
ui.radio_value(
@@ -179,7 +179,7 @@ impl TableDemo {
179179
});
180180
}
181181
}
182-
DemoType::ManyHomogenous => {
182+
DemoType::ManyHomogeneous => {
183183
body.rows(text_height, self.num_rows, |row_index, mut row| {
184184
row.col(|ui| {
185185
ui.label(row_index.to_string());

crates/egui_demo_lib/src/demo/tests.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ impl super::View for IdTest {
5252

5353
ui.label("\
5454
Widgets that store state require unique and persisting identifiers so we can track their state between frames.\n\
55-
For instance, collapsable headers needs to store whether or not they are open. \
55+
For instance, collapsible headers needs to store whether or not they are open. \
5656
Their Id:s are derived from their names. \
5757
If you fail to give them unique names then clicking one will open both. \
5858
To help you debug this, an error message is printed on screen:");

crates/egui_demo_lib/src/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ pub const LOREM_IPSUM: &str = "Lorem ipsum dolor sit amet, consectetur adipiscin
5656

5757
pub const LOREM_IPSUM_LONG: &str = "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
5858
59-
Curabitur pretium tincidunt lacus. Nulla gravida orci a odio. Nullam varius, turpis et commodo pharetra, est eros bibendum elit, nec luctus magna felis sollicitudin mauris. Integer in mauris eu nibh euismod gravida. Duis ac tellus et risus vulputate vehicula. Donec lobortis risus a elit. Etiam tempor. Ut ullamcorper, ligula eu tempor congue, eros est euismod turpis, id tincidunt sapien risus a quam. Maecenas fermentum consequat mi. Donec fermentum. Pellentesque malesuada nulla a mi. Duis sapien sem, aliquet nec, commodo eget, consequat quis, neque. Aliquam faucibus, elit ut dictum aliquet, felis nisl adipiscing sapien, sed malesuada diam lacus eget erat. Cras mollis scelerisque nunc. Nullam arcu. Aliquam consequat. Curabitur augue lorem, dapibus quis, laoreet et, pretium ac, nisi. Aenean magna nisl, mollis quis, molestie eu, feugiat in, orci. In hac habitasse platea dictumst.";
59+
Curabitur pretium tincidunt lacus. Nulla gravida orci a odio. Nullam various, turpis et commodo pharetra, est eros bibendum elit, nec luctus magna felis sollicitudin mauris. Integer in mauris eu nibh euismod gravida. Duis ac tellus et risus vulputate vehicula. Donec lobortis risus a elit. Etiam tempor. Ut ullamcorper, ligula eu tempor congue, eros est euismod turpis, id tincidunt sapien risus a quam. Maecenas fermentum consequat mi. Donec fermentum. Pellentesque malesuada nulla a mi. Duis sapien sem, aliquet nec, commodo eget, consequat quis, neque. Aliquam faucibus, elit ut dictum aliquet, felis nisl adipiscing sapien, sed malesuada diam lacus eget erat. Cras mollis scelerisque nunc. Nullam arcu. Aliquam consequat. Curabitur augue lorem, dapibus quis, laoreet et, pretium ac, nisi. Aenean magna nisl, mollis quis, molestie eu, feugiat in, orci. In hac habitasse platea dictumst.";
6060

6161
// ----------------------------------------------------------------------------
6262

crates/epaint/src/shape.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -625,7 +625,7 @@ pub struct TextShape {
625625
/// Top left corner of the first character.
626626
pub pos: Pos2,
627627

628-
/// The layed out text, from [`Fonts::layout_job`].
628+
/// The laid out text, from [`Fonts::layout_job`].
629629
pub galley: Arc<Galley>,
630630

631631
/// Add this underline to the whole text.

crates/epaint/src/text/text_layout.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ pub fn layout(fonts: &mut FontsImpl, job: Arc<LayoutJob>) -> Galley {
7070
for (i, row) in rows.iter_mut().enumerate() {
7171
let is_last_row = i + 1 == num_rows;
7272
let justify_row = justify && !row.ends_with_newline && !is_last_row;
73-
halign_and_jusitfy_row(
73+
halign_and_justify_row(
7474
point_scale,
7575
row,
7676
job.halign,
@@ -337,7 +337,7 @@ fn replace_last_glyph_with_overflow_character(
337337
}
338338
}
339339

340-
fn halign_and_jusitfy_row(
340+
fn halign_and_justify_row(
341341
point_scale: PointScale,
342342
row: &mut Row,
343343
halign: Align,

crates/epaint/src/text/text_layout_types.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -850,7 +850,7 @@ impl Galley {
850850
// keep same X coord
851851
let x = self.pos_from_cursor(cursor).center().x;
852852
let column = if x > self.rows[new_row].rect.right() {
853-
// beyond the end of this row - keep same colum
853+
// beyond the end of this row - keep same column
854854
cursor.rcursor.column
855855
} else {
856856
self.rows[new_row].char_at(x)

docs/egui_demo_app.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -351,10 +351,10 @@ class WebHandle {
351351
/**
352352
* @param {string} _some_data
353353
*/
354-
set_some_content_from_javasript(_some_data) {
354+
set_some_content_from_javascript(_some_data) {
355355
const ptr0 = passStringToWasm0(_some_data, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
356356
const len0 = WASM_VECTOR_LEN;
357-
wasm.webhandle_set_some_content_from_javasript(this.ptr, ptr0, len0);
357+
wasm.webhandle_set_some_content_from_javascript(this.ptr, ptr0, len0);
358358
}
359359
}
360360
__exports.WebHandle = WebHandle;

0 commit comments

Comments
 (0)