Skip to content

Commit 9009c8c

Browse files
alexandearbep
authored andcommitted
all: Fix typos in function names and comments
1 parent 12dc9a6 commit 9009c8c

27 files changed

+41
-41
lines changed

cache/docs.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
// Package cache contains the differenct cache implementations.
1+
// Package cache contains the different cache implementations.
22
package cache

cache/filecache/filecache_config.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ type FileCacheConfig struct {
8181
// Max age of cache entries in this cache. Any items older than this will
8282
// be removed and not returned from the cache.
8383
// A negative value means forever, 0 means cache is disabled.
84-
// Hugo is leninent with what types it accepts here, but we recommend using
84+
// Hugo is lenient with what types it accepts here, but we recommend using
8585
// a duration string, a sequence of decimal numbers, each with optional fraction and a unit suffix,
8686
// such as "300ms", "1.5h" or "2h45m".
8787
// Valid time units are "ns", "us" (or "µs"), "ms", "s", "m", "h".

commands/commandeer.go

+4-4
Original file line numberDiff line numberDiff line change
@@ -238,11 +238,11 @@ func (r *rootCommand) ConfigFromProvider(key int32, cfg config.Provider) (*commo
238238
renderStaticToDisk := cfg.GetBool("renderStaticToDisk")
239239

240240
sourceFs := hugofs.Os
241-
var desinationFs afero.Fs
241+
var destinationFs afero.Fs
242242
if cfg.GetBool("renderToDisk") {
243-
desinationFs = hugofs.Os
243+
destinationFs = hugofs.Os
244244
} else {
245-
desinationFs = afero.NewMemMapFs()
245+
destinationFs = afero.NewMemMapFs()
246246
if renderStaticToDisk {
247247
// Hybrid, render dynamic content to Root.
248248
cfg.Set("publishDirDynamic", "/")
@@ -253,7 +253,7 @@ func (r *rootCommand) ConfigFromProvider(key int32, cfg config.Provider) (*commo
253253
}
254254
}
255255

256-
fs := hugofs.NewFromSourceAndDestination(sourceFs, desinationFs, cfg)
256+
fs := hugofs.NewFromSourceAndDestination(sourceFs, destinationFs, cfg)
257257

258258
if renderStaticToDisk {
259259
dynamicFs := fs.PublishDir

commands/convert.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ type convertCommand struct {
8484
r *rootCommand
8585
h *hugolib.HugoSites
8686

87-
// Commmands.
87+
// Commands.
8888
commands []simplecobra.Commander
8989
}
9090

common/herrors/error_locator.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ type LineMatcher struct {
3333
}
3434

3535
// LineMatcherFn is used to match a line with an error.
36-
// It returns the column number or 0 if the line was found, but column could not be determinde. Returns -1 if no line match.
36+
// It returns the column number or 0 if the line was found, but column could not be determined. Returns -1 if no line match.
3737
type LineMatcherFn func(m LineMatcher) int
3838

3939
// SimpleLineMatcher simply matches by line number.

common/herrors/file_error.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,7 @@ func extractFileTypePos(err error) (string, text.Position) {
297297
}
298298

299299
// The error type from the minifier contains line number and column number.
300-
if line, col := exctractLineNumberAndColumnNumber(err); line >= 0 {
300+
if line, col := extractLineNumberAndColumnNumber(err); line >= 0 {
301301
pos.LineNumber = line
302302
pos.ColumnNumber = col
303303
return fileType, pos
@@ -369,7 +369,7 @@ func extractOffsetAndType(e error) (int, string) {
369369
}
370370
}
371371

372-
func exctractLineNumberAndColumnNumber(e error) (int, int) {
372+
func extractLineNumberAndColumnNumber(e error) (int, int) {
373373
switch v := e.(type) {
374374
case *parse.Error:
375375
return v.Line, v.Column

common/hexec/exec.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ func SafeCommand(name string, arg ...string) (*exec.Cmd, error) {
118118
return exec.Command(bin, arg...), nil
119119
}
120120

121-
// Exec encorces a security policy for commands run via os/exec.
121+
// Exec enforces a security policy for commands run via os/exec.
122122
type Exec struct {
123123
sc security.Config
124124

common/paths/path.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ func extractFilename(in, ext, base, pathSeparator string) (name string) {
209209
// return the filename minus the extension (and the ".")
210210
name = base[:strings.LastIndex(base, ".")]
211211
} else {
212-
// no extension case so just return base, which willi
212+
// no extension case so just return base, which will
213213
// be the filename
214214
name = base
215215
}

config/allconfig/allconfig.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -424,10 +424,10 @@ type RootConfig struct {
424424
// Copyright information.
425425
Copyright string
426426

427-
// The language to apply to content without any Clolanguage indicator.
427+
// The language to apply to content without any language indicator.
428428
DefaultContentLanguage string
429429

430-
// By defefault, we put the default content language in the root and the others below their language ID, e.g. /no/.
430+
// By default, we put the default content language in the root and the others below their language ID, e.g. /no/.
431431
// Set this to true to put all languages below their language ID.
432432
DefaultContentLanguageInSubdir bool
433433

config/commonConfig.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ var defaultBuild = BuildConfig{
9797
Source: `(postcss|tailwind)\.config\.js`,
9898
Target: cssTargetCachebusterRe,
9999
},
100-
// This is deliberatly coarse grained; it will cache bust resources with "json" in the cache key when js files changes, which is good.
100+
// This is deliberately coarse grained; it will cache bust resources with "json" in the cache key when js files changes, which is good.
101101
{
102102
Source: `assets/.*\.(.*)$`,
103103
Target: `$1`,
@@ -113,7 +113,7 @@ type BuildConfig struct {
113113
// related aggregated data (e.g. CSS class names).
114114
WriteStats bool
115115

116-
// Can be used to toggle off writing of the intellinsense /assets/jsconfig.js
116+
// Can be used to toggle off writing of the IntelliSense /assets/jsconfig.js
117117
// file.
118118
NoJSConfigInAssets bool
119119

helpers/emoji.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ var (
3030
emojiMaxSize int
3131
)
3232

33-
// Emoji returns the emojy given a key, e.g. ":smile:", nil if not found.
33+
// Emoji returns the emoji given a key, e.g. ":smile:", nil if not found.
3434
func Emoji(key string) []byte {
3535
emojiInit.Do(initEmoji)
3636
return emojis[key]

helpers/emoji_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ func TestEmojiCustom(t *testing.T) {
4141
{" :beer: :", []byte(" 🍺 :")},
4242
{":beer: and :smile: and another :beer:!", []byte("🍺 and 😄 and another 🍺!")},
4343
{" :beer: : ", []byte(" 🍺 : ")},
44-
{"No smilies for you!", []byte("No smilies for you!")},
44+
{"No smiles for you!", []byte("No smiles for you!")},
4545
{" The motto: no smiles! ", []byte(" The motto: no smiles! ")},
4646
{":hugo_is_the_best_static_gen:", []byte(":hugo_is_the_best_static_gen:")},
4747
{"은행 :smile: 은행", []byte("은행 😄 은행")},

htesting/test_helpers.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ func init() {
3838
}
3939

4040
// CreateTempDir creates a temp dir in the given filesystem and
41-
// returns the dirnam and a func that removes it when done.
41+
// returns the dirname and a func that removes it when done.
4242
func CreateTempDir(fs afero.Fs, prefix string) (string, func(), error) {
4343
tempDir, err := afero.TempDir(fs, "", prefix)
4444
if err != nil {

hugofs/filter_fs.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ func NewLanguageFs(langs map[string]int, fs afero.Fs) (afero.Fs, error) {
9292
fim := fi.(FileMetaInfo)
9393
langs := translations[fim.Meta().TranslationBaseNameWithExt]
9494
if len(langs) > 0 {
95-
fim.Meta().Translations = sortAndremoveStringDuplicates(langs)
95+
fim.Meta().Translations = sortAndRemoveStringDuplicates(langs)
9696
}
9797
}
9898
}
@@ -328,7 +328,7 @@ func printFs(fs afero.Fs, path string, w io.Writer) {
328328
})
329329
}
330330

331-
func sortAndremoveStringDuplicates(s []string) []string {
331+
func sortAndRemoveStringDuplicates(s []string) []string {
332332
ss := sort.StringSlice(s)
333333
ss.Sort()
334334
i := 0

hugofs/fs.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ func MakeReadableAndRemoveAllModulePkgDir(fs afero.Fs, dir string) (int, error)
175175
}
176176

177177
// IsOsFs returns whether fs is an OsFs or if it fs wraps an OsFs.
178-
// TODO(bep) make this nore robust.
178+
// TODO(bep) make this more robust.
179179
func IsOsFs(fs afero.Fs) bool {
180180
var isOsFs bool
181181
WalkFilesystems(fs, func(fs afero.Fs) bool {

hugofs/glob/filename_filter_test.go

+4-4
Original file line numberDiff line numberDiff line change
@@ -59,11 +59,11 @@ func TestFilenameFilter(t *testing.T) {
5959
c.Assert(includeOnlyFilter.Match("ab.jpg", false), qt.Equals, true)
6060
c.Assert(includeOnlyFilter.Match("ab.gif", false), qt.Equals, false)
6161

62-
exlcudeOnlyFilter, err := NewFilenameFilter(nil, []string{"**.json", "**.jpg"})
62+
excludeOnlyFilter, err := NewFilenameFilter(nil, []string{"**.json", "**.jpg"})
6363
c.Assert(err, qt.IsNil)
64-
c.Assert(exlcudeOnlyFilter.Match("ab.json", false), qt.Equals, false)
65-
c.Assert(exlcudeOnlyFilter.Match("ab.jpg", false), qt.Equals, false)
66-
c.Assert(exlcudeOnlyFilter.Match("ab.gif", false), qt.Equals, true)
64+
c.Assert(excludeOnlyFilter.Match("ab.json", false), qt.Equals, false)
65+
c.Assert(excludeOnlyFilter.Match("ab.jpg", false), qt.Equals, false)
66+
c.Assert(excludeOnlyFilter.Match("ab.gif", false), qt.Equals, true)
6767

6868
var nilFilter *FilenameFilter
6969
c.Assert(nilFilter.Match("ab.gif", false), qt.Equals, true)

hugolib/config_test.go

+4-4
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ func TestLoadConfigLanguageParamsOverrideIssue10620(t *testing.T) {
3535
files := `
3636
-- hugo.toml --
3737
baseURL = "https://example.com"
38-
disableKinds = ["taxonomy", "term", "RSS", "sitemap", "robotsTXT", "page", "setion"]
38+
disableKinds = ["taxonomy", "term", "RSS", "sitemap", "robotsTXT", "page", "section"]
3939
title = "Base Title"
4040
staticDir = "mystatic"
4141
[params]
@@ -79,7 +79,7 @@ func TestLoadConfig(t *testing.T) {
7979
files := `
8080
-- hugo.toml --
8181
baseURL = "https://example.com"
82-
disableKinds = ["taxonomy", "term", "RSS", "sitemap", "robotsTXT", "page", "setion"]
82+
disableKinds = ["taxonomy", "term", "RSS", "sitemap", "robotsTXT", "page", "section"]
8383
title = "Base Title"
8484
staticDir = "mystatic"
8585
[params]
@@ -131,7 +131,7 @@ myparam = "svParamValue"
131131
files := `
132132
-- hugo.toml --
133133
baseURL = "https://example.com"
134-
disableKinds = ["taxonomy", "term", "RSS", "sitemap", "robotsTXT", "page", "setion"]
134+
disableKinds = ["taxonomy", "term", "RSS", "sitemap", "robotsTXT", "page", "section"]
135135
title = "Base Title"
136136
defaultContentLanguage = "sv"
137137
disableLanguages = ["sv"]
@@ -178,7 +178,7 @@ running = true
178178
files := `
179179
-- hugo.toml --
180180
baseURL = "https://example.com"
181-
disableKinds = ["taxonomy", "term", "RSS", "sitemap", "robotsTXT", "page", "setion"]
181+
disableKinds = ["taxonomy", "term", "RSS", "sitemap", "robotsTXT", "page", "section"]
182182
title = "Base Title"
183183
[params]
184184
p1 = "p1base"

hugolib/configdir_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ b = "bc1"
3030
3131
-- hugo.toml --
3232
baseURL = "https://example.com"
33-
disableKinds = ["taxonomy", "term", "RSS", "sitemap", "robotsTXT", "page", "setion"]
33+
disableKinds = ["taxonomy", "term", "RSS", "sitemap", "robotsTXT", "page", "section"]
3434
ignoreErrors = ["error-missing-instagram-accesstoken"]
3535
[params]
3636
a = "a1"

hugolib/datafiles_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ func TestData(t *testing.T) {
2525
files := `
2626
-- hugo.toml --
2727
baseURL = "https://example.com"
28-
disableKinds = ["taxonomy", "term", "RSS", "sitemap", "robotsTXT", "page", "setion"]
28+
disableKinds = ["taxonomy", "term", "RSS", "sitemap", "robotsTXT", "page", "section"]
2929
theme = "mytheme"
3030
-- data/a.toml --
3131
v1 = "a_v1"

hugolib/embedded_shortcodes_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ func TestEmbeddedShortcodes(t *testing.T) {
3030
files := `
3131
-- hugo.toml --
3232
baseURL = "https://example.com"
33-
disableKinds = ["taxonomy", "term", "RSS", "sitemap", "robotsTXT", "page", "setion"]
33+
disableKinds = ["taxonomy", "term", "RSS", "sitemap", "robotsTXT", "page", "section"]
3434
ignoreErrors = ["error-missing-instagram-accesstoken"]
3535
[params]
3636
foo = "bar"

hugolib/hugo_sites_build.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -326,7 +326,7 @@ func (h *HugoSites) postProcess(l logg.LevelLogger) error {
326326
// This will only be set when js.Build have been triggered with
327327
// imports that resolves to the project or a module.
328328
// Write a jsconfig.json file to the project's /asset directory
329-
// to help JS intellisense in VS Code etc.
329+
// to help JS IntelliSense in VS Code etc.
330330
if !h.ResourceSpec.BuildConfig().NoJSConfigInAssets && h.BaseFs.Assets.Dirs != nil {
331331
fi, err := h.BaseFs.Assets.Fs.Stat("")
332332
if err != nil {

hugolib/pagecollections_test.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ func TestGetPage(t *testing.T) {
235235
{"Root relative, no slash, root page", page.KindPage, nil, []string{"about.md", "ABOUT.md"}, "about page"},
236236
{"Root relative, no slash, section", page.KindSection, nil, []string{"sect3"}, "section 3"},
237237
{"Root relative, no slash, section page", page.KindPage, nil, []string{"sect3/page1.md"}, "Title3_1"},
238-
{"Root relative, no slash, sub setion", page.KindSection, nil, []string{"sect3/sect7"}, "another sect7"},
238+
{"Root relative, no slash, sub section", page.KindSection, nil, []string{"sect3/sect7"}, "another sect7"},
239239
{"Root relative, no slash, nested page", page.KindPage, nil, []string{"sect3/subsect/deep.md"}, "deep page"},
240240
{"Root relative, no slash, OS slashes", page.KindPage, nil, []string{filepath.FromSlash("sect5/page3.md")}, "Title5_3"},
241241

@@ -247,7 +247,7 @@ func TestGetPage(t *testing.T) {
247247
// content root relative paths without a leading slash, the lookup
248248
// returns /sect7. This undermines ambiguity detection, but we have no choice.
249249
//{"Ambiguous", nil, []string{"sect7"}, ""},
250-
{"Section, ambigous", page.KindSection, nil, []string{"sect7"}, "Sect7s"},
250+
{"Section, ambiguous", page.KindSection, nil, []string{"sect7"}, "Sect7s"},
251251

252252
{"Absolute, home", page.KindHome, nil, []string{"/", ""}, "home page"},
253253
{"Absolute, page", page.KindPage, nil, []string{"/about.md", "/about"}, "about page"},

hugolib/site.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -885,7 +885,7 @@ func (s *Site) getLanguageTargetPathLang(alwaysInSubDir bool) string {
885885
return s.getLanguagePermalinkLang(alwaysInSubDir)
886886
}
887887

888-
// get any lanaguagecode to prefix the relative permalink with.
888+
// get any language code to prefix the relative permalink with.
889889
func (s *Site) getLanguagePermalinkLang(alwaysInSubDir bool) string {
890890
if !s.h.isMultiLingual() || s.h.Conf.IsMultihost() {
891891
return ""

langs/language.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ func NewLanguage(lang, defaultContentLanguage, timeZone string, languageConfig L
9292
return l, l.loadLocation(timeZone)
9393
}
9494

95-
// This is injected from hugolib to avoid cirular dependencies.
95+
// This is injected from hugolib to avoid circular dependencies.
9696
var DeprecationFunc = func(item, alternative string, err bool) {}
9797

9898
const paramsDeprecationWarning = `.Language.Params is deprecated and will be removed in a future release. Use site.Params instead.

livereload/livereload.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ func refreshPathForPort(s string, port int) {
143143
wsHub.broadcast <- []byte(msg)
144144
}
145145

146-
// ServeJS serves the liverreload.js who's reference is injected into the page.
146+
// ServeJS serves the livereload.js who's reference is injected into the page.
147147
func ServeJS(w http.ResponseWriter, r *http.Request) {
148148
w.Header().Set("Content-Type", media.Builtin.JavascriptType.Type)
149149
w.Write(liveReloadJS())

resources/jsconfig/jsconfig.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ import (
2020
)
2121

2222
// Builder builds a jsconfig.json file that, currently, is used only to assist
23-
// intellinsense in editors.
23+
// IntelliSense in editors.
2424
type Builder struct {
2525
sourceRootsMu sync.RWMutex
2626
sourceRoots map[string]bool

resources/resource_transformers/js/options.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ func createBuildPlugins(c *Client, opts Options) ([]api.Plugin, error) {
239239

240240
if m != nil {
241241
// Store the source root so we can create a jsconfig.json
242-
// to help intellisense when the build is done.
242+
// to help IntelliSense when the build is done.
243243
// This should be a small number of elements, and when
244244
// in server mode, we may get stale entries on renames etc.,
245245
// but that shouldn't matter too much.

0 commit comments

Comments
 (0)