Skip to content

Commit 114de63

Browse files
committed
Fix various typos in source code
This only touches code comments, class names, documentation, enumeration names and tests.
1 parent 9e97eca commit 114de63

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

63 files changed

+104
-104
lines changed

src/libcmd/include/nix/cmd/common-eval-args.hh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,17 +23,17 @@ struct SourcePath;
2323
namespace flake { struct Settings; }
2424

2525
/**
26-
* @todo Get rid of global setttings variables
26+
* @todo Get rid of global settings variables
2727
*/
2828
extern fetchers::Settings fetchSettings;
2929

3030
/**
31-
* @todo Get rid of global setttings variables
31+
* @todo Get rid of global settings variables
3232
*/
3333
extern EvalSettings evalSettings;
3434

3535
/**
36-
* @todo Get rid of global setttings variables
36+
* @todo Get rid of global settings variables
3737
*/
3838
extern flake::Settings flakeSettings;
3939

src/libcmd/repl.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,7 @@ StringSet NixRepl::completePrefix(const std::string & prefix)
294294
} catch (BadURL & e) {
295295
// Quietly ignore BadURL flake-related errors.
296296
} catch (FileNotFound & e) {
297-
// Quietly ignore non-existent file beeing `import`-ed.
297+
// Quietly ignore non-existent file being `import`-ed.
298298
}
299299
}
300300

src/libexpr-tests/error_traces.cc

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -458,7 +458,7 @@ namespace nix {
458458
HintFmt("expected a function but found %s: %s", "a list", Uncolored("[ ]")),
459459
HintFmt("while evaluating the first argument passed to builtins.filterSource"));
460460

461-
// Usupported by store "dummy"
461+
// Unsupported by store "dummy"
462462

463463
// ASSERT_TRACE2("filterSource (_: 1) ./.",
464464
// TypeError,
@@ -636,7 +636,7 @@ namespace nix {
636636
HintFmt("expected a set but found %s: %s", "a list", Uncolored("[ ]")),
637637
HintFmt("while evaluating the second argument passed to builtins.mapAttrs"));
638638

639-
// XXX: defered
639+
// XXX: deferred
640640
// ASSERT_TRACE2("mapAttrs \"\" { foo.bar = 1; }",
641641
// TypeError,
642642
// HintFmt("attempt to call something which is not a function but %s", "a string"),
@@ -666,9 +666,9 @@ namespace nix {
666666
HintFmt("expected a set but found %s: %s", "an integer", Uncolored(ANSI_CYAN "1" ANSI_NORMAL)),
667667
HintFmt("while evaluating a value of the list passed as second argument to builtins.zipAttrsWith"));
668668

669-
// XXX: How to properly tell that the fucntion takes two arguments ?
669+
// XXX: How to properly tell that the function takes two arguments ?
670670
// The same question also applies to sort, and maybe others.
671-
// Due to lazyness, we only create a thunk, and it fails later on.
671+
// Due to laziness, we only create a thunk, and it fails later on.
672672
// ASSERT_TRACE2("zipAttrsWith (_: 1) [ { foo = 1; } ]",
673673
// TypeError,
674674
// HintFmt("attempt to call something which is not a function but %s", "an integer"),
@@ -877,7 +877,7 @@ namespace nix {
877877
HintFmt("expected a function but found %s: %s", "an integer", Uncolored(ANSI_CYAN "1" ANSI_NORMAL)),
878878
HintFmt("while evaluating the first argument passed to builtins.genList"));
879879

880-
// XXX: defered
880+
// XXX: deferred
881881
// ASSERT_TRACE2("genList (x: x + \"foo\") 2 #TODO",
882882
// TypeError,
883883
// HintFmt("cannot add %s to an integer", "a string"),

src/libexpr-tests/trivial.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ namespace nix {
143143
// Usually Nix rejects duplicate keys in an attrset but it does allow
144144
// so if it is an attribute set that contains disjoint sets of keys.
145145
// The below is equivalent to `{a.b = 1; a.c = 2; }`.
146-
// The attribute set `a` will be a Thunk at first as the attribuets
146+
// The attribute set `a` will be a Thunk at first as the attributes
147147
// have to be merged (or otherwise computed) and that is done in a lazy
148148
// manner.
149149

src/libexpr/eval.cc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -657,7 +657,7 @@ std::optional<EvalState::Doc> EvalState::getDoc(Value & v)
657657
Value & functor = *v.attrs()->find(sFunctor)->value;
658658
Value * vp[] = {&v};
659659
Value partiallyApplied;
660-
// The first paramater is not user-provided, and may be
660+
// The first parameter is not user-provided, and may be
661661
// handled by code that is opaque to the user, like lib.const = x: y: y;
662662
// So preferably we show docs that are relevant to the
663663
// "partially applied" function returned by e.g. `const`.
@@ -2495,7 +2495,7 @@ SourcePath EvalState::coerceToPath(const PosIdx pos, Value & v, NixStringContext
24952495
}
24962496
}
24972497

2498-
/* Any other value should be coercable to a string, interpreted
2498+
/* Any other value should be coercible to a string, interpreted
24992499
relative to the root filesystem. */
25002500
auto path = coerceToString(pos, v, context, errorCtx, false, false, true).toOwned();
25012501
if (path == "" || path[0] != '/')
@@ -2866,7 +2866,7 @@ bool EvalState::fullGC() {
28662866
GC_gcollect();
28672867
// Check that it ran. We might replace this with a version that uses more
28682868
// of the boehm API to get this reliably, at a maintenance cost.
2869-
// We use a 1K margin because technically this has a race condtion, but we
2869+
// We use a 1K margin because technically this has a race condition, but we
28702870
// probably won't encounter it in practice, because the CLI isn't concurrent
28712871
// like that.
28722872
return GC_get_bytes_since_gc() < 1024;

src/libexpr/include/nix/expr/eval-settings.hh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ struct PrimOp;
1313
struct EvalSettings : Config
1414
{
1515
/**
16-
* Function used to interpet look path entries of a given scheme.
16+
* Function used to interpret look path entries of a given scheme.
1717
*
1818
* The argument is the non-scheme part of the lookup path entry (see
1919
* `LookupPathHooks` below).

src/libexpr/lexer-helpers.hh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
#include <cstddef>
44

5-
// inluding the generated headers twice leads to errors
5+
// including the generated headers twice leads to errors
66
#ifndef BISON_HEADER
77
# include "lexer-tab.hh"
88
# include "parser-tab.hh"

src/libexpr/primops.cc

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -890,7 +890,7 @@ static void prim_ceil(EvalState & state, const PosIdx pos, Value * * args, Value
890890
auto arg = args[0]->integer();
891891
auto res = v.integer();
892892
if (arg != res) {
893-
state.error<EvalError>("Due to a bug (see https://github.com/NixOS/nix/issues/12899) a loss of precision occured in previous Nix versions because the NixInt argument %1% was rounded to %2%.\n\tFuture Nix versions might implement the correct behavior.", arg, res).atPos(pos).debugThrow();
893+
state.error<EvalError>("Due to a bug (see https://github.com/NixOS/nix/issues/12899) a loss of precision occurred in previous Nix versions because the NixInt argument %1% was rounded to %2%.\n\tFuture Nix versions might implement the correct behavior.", arg, res).atPos(pos).debugThrow();
894894
}
895895
}
896896
}
@@ -931,7 +931,7 @@ static void prim_floor(EvalState & state, const PosIdx pos, Value * * args, Valu
931931
auto arg = args[0]->integer();
932932
auto res = v.integer();
933933
if (arg != res) {
934-
state.error<EvalError>("Due to a bug (see https://github.com/NixOS/nix/issues/12899) a loss of precision occured in previous Nix versions because the NixInt argument %1% was rounded to %2%.\n\tFuture Nix versions might implement the correct behavior.", arg, res).atPos(pos).debugThrow();
934+
state.error<EvalError>("Due to a bug (see https://github.com/NixOS/nix/issues/12899) a loss of precision occurred in previous Nix versions because the NixInt argument %1% was rounded to %2%.\n\tFuture Nix versions might implement the correct behavior.", arg, res).atPos(pos).debugThrow();
935935
}
936936
}
937937
}
@@ -965,7 +965,7 @@ static void prim_tryEval(EvalState & state, const PosIdx pos, Value * * args, Va
965965
ReplExitStatus (* savedDebugRepl)(ref<EvalState> es, const ValMap & extraEnv) = nullptr;
966966
if (state.debugRepl && state.settings.ignoreExceptionsDuringTry)
967967
{
968-
/* to prevent starting the repl from exceptions withing a tryEval, null it. */
968+
/* to prevent starting the repl from exceptions within a tryEval, null it. */
969969
savedDebugRepl = state.debugRepl;
970970
state.debugRepl = nullptr;
971971
}
@@ -2172,7 +2172,7 @@ static RegisterPrimOp primop_outputOf({
21722172
[input placeholder string](@docroot@/store/derivation/index.md#input-placeholder)
21732173
if needed.
21742174
2175-
If the derivation has a statically-known output path (i.e. the derivation output is input-addressed, or fixed content-addresed), the output path will just be returned.
2175+
If the derivation has a statically-known output path (i.e. the derivation output is input-addressed, or fixed content-addressed), the output path will just be returned.
21762176
But if the derivation is content-addressed or if the derivation is itself not-statically produced (i.e. is the output of another derivation), an input placeholder will be returned instead.
21772177
21782178
*`derivation reference`* must be a string that may contain a regular store path to a derivation, or may be an input placeholder reference.
@@ -2815,7 +2815,7 @@ static RegisterPrimOp primop_unsafeGetAttrPos(PrimOp {
28152815
.fun = prim_unsafeGetAttrPos,
28162816
});
28172817

2818-
// access to exact position information (ie, line and colum numbers) is deferred
2818+
// access to exact position information (ie, line and column numbers) is deferred
28192819
// due to the cost associated with calculating that information and how rarely
28202820
// it is used in practice. this is achieved by creating thunks to otherwise
28212821
// inaccessible primops that are not exposed as __op or under builtins to turn
@@ -2827,7 +2827,7 @@ static RegisterPrimOp primop_unsafeGetAttrPos(PrimOp {
28272827
// but each type of thunk has an associated runtime cost in the current evaluator.
28282828
// as with black holes this cost is too high to justify another thunk type to check
28292829
// for in the very hot path that is forceValue.
2830-
static struct LazyPosAcessors {
2830+
static struct LazyPosAccessors {
28312831
PrimOp primop_lineOfPos{
28322832
.arity = 1,
28332833
.fun = [] (EvalState & state, PosIdx pos, Value * * args, Value & v) {
@@ -2843,7 +2843,7 @@ static struct LazyPosAcessors {
28432843

28442844
Value lineOfPos, columnOfPos;
28452845

2846-
LazyPosAcessors()
2846+
LazyPosAccessors()
28472847
{
28482848
lineOfPos.mkPrimOp(&primop_lineOfPos);
28492849
columnOfPos.mkPrimOp(&primop_columnOfPos);
@@ -3623,7 +3623,7 @@ static void prim_genList(EvalState & state, const PosIdx pos, Value * * args, Va
36233623

36243624
size_t len = size_t(len_);
36253625

3626-
// More strict than striclty (!) necessary, but acceptable
3626+
// More strict than strictly (!) necessary, but acceptable
36273627
// as evaluating map without accessing any values makes little sense.
36283628
state.forceFunction(*args[0], noPos, "while evaluating the first argument passed to builtins.genList");
36293629

@@ -4126,7 +4126,7 @@ static void prim_substring(EvalState & state, const PosIdx pos, Value * * args,
41264126
}
41274127

41284128
// Special-case on empty substring to avoid O(n) strlen
4129-
// This allows for the use of empty substrings to efficently capture string context
4129+
// This allows for the use of empty substrings to efficiently capture string context
41304130
if (len == 0) {
41314131
state.forceValue(*args[2], pos);
41324132
if (args[2]->type() == nString) {
@@ -4442,7 +4442,7 @@ void prim_split(EvalState & state, const PosIdx pos, Value * * args, Value & v)
44424442
// Add a list for matched substrings.
44434443
const size_t slen = match.size() - 1;
44444444

4445-
// Start at 1, beacause the first match is the whole string.
4445+
// Start at 1, because the first match is the whole string.
44464446
auto list2 = state.buildList(slen);
44474447
for (const auto & [si, v2] : enumerate(list2)) {
44484448
if (!match[si + 1].matched)

src/libexpr/primops/fetchTree.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,7 @@ static RegisterPrimOp primop_fetchTree({
305305
- `"tarball"`
306306
307307
Download a tar archive and extract it into the Nix store.
308-
This has the same underyling implementation as [`builtins.fetchTarball`](@docroot@/language/builtins.md#builtins-fetchTarball)
308+
This has the same underlying implementation as [`builtins.fetchTarball`](@docroot@/language/builtins.md#builtins-fetchTarball)
309309
310310
- `url` (String, required)
311311

src/libfetchers/git-utils.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -587,7 +587,7 @@ struct GitRepoImpl : GitRepo, std::enable_shared_from_this<GitRepoImpl>
587587
});
588588

589589
/* Evaluate result through status code and checking if public
590-
key fingerprints appear on stderr. This is neccessary
590+
key fingerprints appear on stderr. This is necessary
591591
because the git command might also succeed due to the
592592
commit being signed by gpg keys that are present in the
593593
users key agent. */

0 commit comments

Comments
 (0)