mirror of
https://github.com/oxalica/nil.git
synced 2025-10-06 00:32:51 +02:00
Check and fix typos
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
//! Liveness check of names.
|
//! Liveness check of names.
|
||||||
//! It locates uncessary or inaccessible bindings and expressions, based on name resolution.
|
//! It locates unnecessary or inaccessible bindings and expressions, based on name resolution.
|
||||||
//!
|
//!
|
||||||
//! Our goals are,
|
//! Our goals are,
|
||||||
//! - Applicable.
|
//! - Applicable.
|
||||||
|
@@ -101,7 +101,7 @@ fn source_root_referrer_graph(
|
|||||||
db: &dyn DefDatabase,
|
db: &dyn DefDatabase,
|
||||||
sid: SourceRootId,
|
sid: SourceRootId,
|
||||||
) -> Arc<HashMap<FileId, ModuleReferrers>> {
|
) -> Arc<HashMap<FileId, ModuleReferrers>> {
|
||||||
// Assert our inline threshould costs no extra memory.
|
// Assert our inline threshold costs no extra memory.
|
||||||
const _: [(); std::mem::size_of::<Vec<FileId>>()] =
|
const _: [(); std::mem::size_of::<Vec<FileId>>()] =
|
||||||
[(); std::mem::size_of::<ModuleReferrers>()];
|
[(); std::mem::size_of::<ModuleReferrers>()];
|
||||||
|
|
||||||
|
@@ -127,7 +127,7 @@ impl Fixture {
|
|||||||
let target = VfsPath::new(target);
|
let target = VfsPath::new(target);
|
||||||
flake_info.input_store_paths.insert(name.into(), target);
|
flake_info.input_store_paths.insert(name.into(), target);
|
||||||
} else {
|
} else {
|
||||||
bail!("Unknow property {prop}");
|
bail!("Unknown property {prop}");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if iter.next().is_some() {
|
} else if iter.next().is_some() {
|
||||||
|
@@ -118,14 +118,14 @@ fn main() {
|
|||||||
fn main_diagnostics(args: DiagnosticsArgs) {
|
fn main_diagnostics(args: DiagnosticsArgs) {
|
||||||
let ret = emit_diagnostics_for_files(&args.paths);
|
let ret = emit_diagnostics_for_files(&args.paths);
|
||||||
|
|
||||||
let fail_threshould = if args.deny_warnings {
|
let fail_threshold = if args.deny_warnings {
|
||||||
Severity::Warning
|
Severity::Warning
|
||||||
} else {
|
} else {
|
||||||
Severity::Error
|
Severity::Error
|
||||||
};
|
};
|
||||||
|
|
||||||
match ret {
|
match ret {
|
||||||
Ok(Some(severity)) if severity >= fail_threshould => process::exit(1),
|
Ok(Some(severity)) if severity >= fail_threshold => process::exit(1),
|
||||||
Ok(_) => {}
|
Ok(_) => {}
|
||||||
Err(err) => {
|
Err(err) => {
|
||||||
eprintln!("{err:#}");
|
eprintln!("{err:#}");
|
||||||
|
@@ -41,7 +41,10 @@
|
|||||||
# mismatch.
|
# mismatch.
|
||||||
# If you do want a locked one, use `devShells.full` below.
|
# If you do want a locked one, use `devShells.full` below.
|
||||||
|
|
||||||
fd # Used by pre-push
|
# Used by pre-push
|
||||||
|
fd
|
||||||
|
typos
|
||||||
|
|
||||||
nodejs
|
nodejs
|
||||||
watchman # Required by coc.nvim for file watching.
|
watchman # Required by coc.nvim for file watching.
|
||||||
|
|
||||||
|
@@ -1,12 +1,15 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
set -eu
|
set -eu
|
||||||
# Requires: [ git nixfmt-rfc-style fd ], rust toolchain, npm toolchain
|
# Requires: [ git nixfmt-rfc-style fd typos ], rust toolchain, npm toolchain
|
||||||
|
|
||||||
die() { echo "$*" >&2; exit 1; }
|
die() { echo "$*" >&2; exit 1; }
|
||||||
|
|
||||||
if git_dir="$(git rev-parse --show-toplevel)"; then
|
if git_dir="$(git rev-parse --show-toplevel)"; then
|
||||||
cd "$git_dir"
|
cd "$git_dir"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
typos || die "typos"
|
||||||
|
|
||||||
cargo fmt --all --check \
|
cargo fmt --all --check \
|
||||||
|| die 'cargo fmt failed'
|
|| die 'cargo fmt failed'
|
||||||
fd -e nix --exclude=crates/syntax/test_data --exec-batch nixfmt --check \
|
fd -e nix --exclude=crates/syntax/test_data --exec-batch nixfmt --check \
|
||||||
|
@@ -4,6 +4,7 @@ extend-exclude = [
|
|||||||
]
|
]
|
||||||
|
|
||||||
[default.extend-words]
|
[default.extend-words]
|
||||||
|
typ = "typ" # Uncollide keyword `type`.
|
||||||
froms = "froms"
|
froms = "froms"
|
||||||
regist = "regist" # coc.nvim `registLanguageClient`
|
regist = "regist" # coc.nvim `registLanguageClient`
|
||||||
withs = "withs"
|
withs = "withs"
|
||||||
|
Reference in New Issue
Block a user