Skip to content

Commit 13963b1

Browse files
authored
Merge pull request #159 from magnusuMET/ci/typos
Add typos (and fix them)
2 parents b7f5d69 + ef4873f commit 13963b1

File tree

6 files changed

+34
-7
lines changed

6 files changed

+34
-7
lines changed

.github/workflows/ci.yml

+14-1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ on:
66
branches:
77
- master
88
pull_request:
9+
types:
10+
- opened
11+
- reopened
12+
- synchronize
913
branches:
1014
- master
1115
schedule:
@@ -20,7 +24,16 @@ env:
2024
CARGO_TERM_COLOR: always
2125

2226
jobs:
23-
rustfmt:
27+
typos:
28+
name: Spell checking (typos)
29+
runs-on: ubuntu-latest
30+
steps:
31+
- name: Checkout code
32+
uses: actions/checkout@v4
33+
- name: Check spelling
34+
uses: crate-ci/typos@f12cee1d8f3c79282a98ecb41d235aef17dfa8fd # v1.25.0
35+
36+
format-and-clippy:
2437
name: rustfmt
2538
runs-on: ubuntu-latest
2639
steps:

.typos.toml

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
[files]
2+
extend-exclude = ["netcdf-src/source", "netcdf-sys"]
3+
4+
[default]
5+
extend-ignore-identifiers-re = [
6+
"Dout",
7+
"is_ambigous", # Remove when deprecated item is removed
8+
]

netcdf/src/error.rs

+6
Original file line numberDiff line numberDiff line change
@@ -67,9 +67,15 @@ pub enum Error {
6767
impl Error {
6868
/// Was the error due to ambiguity of the
6969
/// indices or lengths?
70+
#[deprecated(note = "This item has a typo, use is_ambiguous instead")]
7071
pub fn is_ambigous(&self) -> bool {
7172
matches!(self, Self::Ambiguous)
7273
}
74+
/// Was the error due to ambiguity of the
75+
/// indices or lengths?
76+
pub fn is_ambiguous(&self) -> bool {
77+
matches!(self, Self::Ambiguous)
78+
}
7379
}
7480

7581
impl std::error::Error for Error {

netcdf/src/group.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ use super::utils::{checked_with_lock, with_lock};
1313
use super::variable::{Variable, VariableMut};
1414

1515
/// Main component of the netcdf format. Holds all variables,
16-
/// attributes, and dimensions. A group can always see the parents items,
17-
/// but a parent can not access a childs items.
16+
/// attributes, and dimensions. A group can always see the parent's items,
17+
/// but a parent can not access the children's items.
1818
#[derive(Debug, Clone)]
1919
pub struct Group<'f> {
2020
pub(crate) ncid: nc_type,

netcdf/src/types.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -870,7 +870,7 @@ pub(crate) fn read_type(ncid: nc_type, xtype: nc_type) -> Result<NcVariableType>
870870
fields,
871871
}))
872872
}
873-
_ => panic!("Unexcepted base type {base_xtype}"),
873+
_ => panic!("Unexpected base type {base_xtype}"),
874874
}
875875
}
876876

netcdf/src/variable.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ impl<'g> Variable<'g> {
191191
}
192192

193193
/// Access the variable in independent mode
194-
/// for parallell reading using MPI.
194+
/// for parallel reading using MPI.
195195
/// File must have been opened using `open_par`
196196
///
197197
/// This is the default access mode
@@ -200,7 +200,7 @@ impl<'g> Variable<'g> {
200200
self.access_mode(crate::par::AccessMode::Independent)
201201
}
202202
/// Access the variable in collective mode
203-
/// for parallell reading using MPI.
203+
/// for parallel reading using MPI.
204204
/// File must have been opened using `open_par`
205205
#[cfg(feature = "mpi")]
206206
pub fn access_collective(&self) -> error::Result<()> {
@@ -766,7 +766,7 @@ impl<'g> VariableMut<'g> {
766766
start.push(item.start);
767767
if arr_len != item.count {
768768
if arr_len > item.count && item.is_growable && !item.is_upwards_limited {
769-
// Item is allowed to grow to accomodate the
769+
// Item is allowed to grow to accommodate the
770770
// extra values in the array
771771
} else {
772772
return Err(format!(

0 commit comments

Comments
 (0)