Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add typos (and fix them) #159

Merged
merged 4 commits into from
Oct 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ on:
branches:
- master
pull_request:
types:
- opened
- reopened
- synchronize
branches:
- master
schedule:
Expand All @@ -20,7 +24,16 @@ env:
CARGO_TERM_COLOR: always

jobs:
rustfmt:
typos:
name: Spell checking (typos)
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Check spelling
uses: crate-ci/typos@f12cee1d8f3c79282a98ecb41d235aef17dfa8fd # v1.25.0

format-and-clippy:
name: rustfmt
runs-on: ubuntu-latest
steps:
Expand Down
8 changes: 8 additions & 0 deletions .typos.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[files]
extend-exclude = ["netcdf-src/source", "netcdf-sys"]

[default]
extend-ignore-identifiers-re = [
"Dout",
"is_ambigous", # Remove when deprecated item is removed
]
6 changes: 6 additions & 0 deletions netcdf/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,15 @@ pub enum Error {
impl Error {
/// Was the error due to ambiguity of the
/// indices or lengths?
#[deprecated(note = "This item has a typo, use is_ambiguous instead")]
pub fn is_ambigous(&self) -> bool {
matches!(self, Self::Ambiguous)
}
/// Was the error due to ambiguity of the
/// indices or lengths?
pub fn is_ambiguous(&self) -> bool {
matches!(self, Self::Ambiguous)
}
}

impl std::error::Error for Error {
Expand Down
4 changes: 2 additions & 2 deletions netcdf/src/group.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ use super::utils::{checked_with_lock, with_lock};
use super::variable::{Variable, VariableMut};

/// Main component of the netcdf format. Holds all variables,
/// attributes, and dimensions. A group can always see the parents items,
/// but a parent can not access a childs items.
/// attributes, and dimensions. A group can always see the parent's items,
/// but a parent can not access the children's items.
#[derive(Debug, Clone)]
pub struct Group<'f> {
pub(crate) ncid: nc_type,
Expand Down
2 changes: 1 addition & 1 deletion netcdf/src/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -870,7 +870,7 @@ pub(crate) fn read_type(ncid: nc_type, xtype: nc_type) -> Result<NcVariableType>
fields,
}))
}
_ => panic!("Unexcepted base type {base_xtype}"),
_ => panic!("Unexpected base type {base_xtype}"),
}
}

Expand Down
6 changes: 3 additions & 3 deletions netcdf/src/variable.rs
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ impl<'g> Variable<'g> {
}

/// Access the variable in independent mode
/// for parallell reading using MPI.
/// for parallel reading using MPI.
/// File must have been opened using `open_par`
///
/// This is the default access mode
Expand All @@ -200,7 +200,7 @@ impl<'g> Variable<'g> {
self.access_mode(crate::par::AccessMode::Independent)
}
/// Access the variable in collective mode
/// for parallell reading using MPI.
/// for parallel reading using MPI.
/// File must have been opened using `open_par`
#[cfg(feature = "mpi")]
pub fn access_collective(&self) -> error::Result<()> {
Expand Down Expand Up @@ -766,7 +766,7 @@ impl<'g> VariableMut<'g> {
start.push(item.start);
if arr_len != item.count {
if arr_len > item.count && item.is_growable && !item.is_upwards_limited {
// Item is allowed to grow to accomodate the
// Item is allowed to grow to accommodate the
// extra values in the array
} else {
return Err(format!(
Expand Down
Loading