Skip to content

Commit 2715415

Browse files
authored
chore: add typos pre commit hook (#435)
* chore: add typos pre commit hook Signed-off-by: Sertac Ozercan <[email protected]>
1 parent 5a8dfc4 commit 2715415

29 files changed

+73
-67
lines changed

.pre-commit-config.yaml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,18 @@
11
repos:
22
- repo: https://github.com/gitleaks/gitleaks
3-
rev: v8.16.3
3+
rev: v8.21.2
44
hooks:
55
- id: gitleaks
66
- repo: https://github.com/golangci/golangci-lint
7-
rev: v1.52.2
7+
rev: v1.62.0
88
hooks:
99
- id: golangci-lint
1010
- repo: https://github.com/pre-commit/pre-commit-hooks
11-
rev: v4.4.0
11+
rev: v5.0.0
1212
hooks:
1313
- id: end-of-file-fixer
1414
- id: trailing-whitespace
15+
- repo: https://github.com/crate-ci/typos
16+
rev: v1.27.3
17+
hooks:
18+
- id: typos

_typos.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[default.extend-words]
2+
ba = "ba"

cmd/test2json2gha/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ func do(in io.Reader, out io.Writer, modName string) (bool, error) {
113113
}
114114

115115
if te.Test == "" {
116-
// Don't bother processing events that aren't specfically for a test
116+
// Don't bother processing events that aren't specifically for a test
117117
// Go adds extra events in for package level info that we don't need.
118118
continue
119119
}

docs/spec.schema.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,7 @@
277277
},
278278
"additionalProperties": false,
279279
"type": "object",
280-
"description": "CheckOutput is used to specify the exepcted output of a check, such as stdout/stderr or a file."
280+
"description": "CheckOutput is used to specify the expected output of a check, such as stdout/stderr or a file."
281281
},
282282
"Command": {
283283
"properties": {
@@ -520,7 +520,7 @@
520520
"type": "string"
521521
},
522522
"type": "array",
523-
"description": "Version is a list of version constraints for the package.\nThe format of these strings is depenendent on the package manager of the target system.\nExamples:\n [\"\u003e=1.0.0\", \"\u003c2.0.0\"]"
523+
"description": "Version is a list of version constraints for the package.\nThe format of these strings is dependent on the package manager of the target system.\nExamples:\n [\"\u003e=1.0.0\", \"\u003c2.0.0\"]"
524524
},
525525
"arch": {
526526
"items": {
@@ -728,7 +728,7 @@
728728
"$ref": "#/$defs/SourceGenerator"
729729
},
730730
"type": "array",
731-
"description": "Generate is the list generators to run on the source.\n\nGenerators are used to generate additional sources from this source.\nAs an example the `godmod` generator can be used to generate a go module cache from a go source.\nHow a genator operates is dependent on the actual generator.\nGeneators may also cauuse modifications to the build environment.\n\nCurrently only one generator is supported: \"gomod\""
731+
"description": "Generate is the list generators to run on the source.\n\nGenerators are used to generate additional sources from this source.\nAs an example the `gomod` generator can be used to generate a go module cache from a go source.\nHow a generator operates is dependent on the actual generator.\nGenerators may also cauuse modifications to the build environment.\n\nCurrently only one generator is supported: \"gomod\""
732732
}
733733
},
734734
"additionalProperties": false,
@@ -853,11 +853,11 @@
853853
"properties": {
854854
"file": {
855855
"$ref": "#/$defs/SourceInlineFile",
856-
"description": "File is the inline file to generate.\nFile is treated as a literal single file.\n[SourceIsDir] will return false when this is set.\nThis is mutally exclusive with [Dir]"
856+
"description": "File is the inline file to generate.\nFile is treated as a literal single file.\n[SourceIsDir] will return false when this is set.\nThis is mutually exclusive with [Dir]"
857857
},
858858
"dir": {
859859
"$ref": "#/$defs/SourceInlineDir",
860-
"description": "Dir creates a directory with the given files and directories.\n[SourceIsDir] will return true when this is set.\nThis is mutally exclusive with [File]"
860+
"description": "Dir creates a directory with the given files and directories.\n[SourceIsDir] will return true when this is set.\nThis is mutually exclusive with [File]"
861861
}
862862
},
863863
"additionalProperties": false,
@@ -1061,7 +1061,7 @@
10611061
"$ref": "#/$defs/TestSpec"
10621062
},
10631063
"type": "array",
1064-
"description": "Tests are the list of tests to run for the package that should work regardless of target OS\nEach item in this list is run with a separate rootfs and cannot interact with other tests.\nEach [TestSpec] is run with a separate rootfs, asyncronously from other [TestSpec]."
1064+
"description": "Tests are the list of tests to run for the package that should work regardless of target OS\nEach item in this list is run with a separate rootfs and cannot interact with other tests.\nEach [TestSpec] is run with a separate rootfs, asynchronously from other [TestSpec]."
10651065
}
10661066
},
10671067
"additionalProperties": false,

frontend/deb/debroot.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ var patchHeader []byte
3030
var debianInstall []byte
3131

3232
// This creates a directory in the debian root directory for each patch, and copies the patch files into it.
33-
// The format for each patch dir matches what would normaly be under `debian/patches`, just that this is a separate dir for every source we are patching
33+
// The format for each patch dir matches what would normally be under `debian/patches`, just that this is a separate dir for every source we are patching
3434
// This is purely for documenting in the source package how patches are applied in a more readable way than the big merged patch file.
3535
func sourcePatchesDir(sOpt dalec.SourceOpts, base llb.State, dir, name string, spec *dalec.Spec, opts ...llb.ConstraintsOpt) ([]llb.State, error) {
3636
patchesPath := filepath.Join(dir, name)

frontend/deb/template_control.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ func (w *controlWrapper) depends(buf io.Writer, depsSpec *dalec.PackageDependenc
7878
}
7979

8080
// Add in deps vars that will get resolved by debbuild
81-
// In some cases these are not neccessary (maybe even most), but when they are
81+
// In some cases these are not necessary (maybe even most), but when they are
8282
// it is important.
8383
// When not needed lintian may throw warnings but that's ok.
8484
// If these aren't actually needed they'll resolve to nothing and don't cause

frontend/deb/template_rules.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ func (w *rulesWrapper) OverrideSystemd() (fmt.Stringer, error) {
136136
// custom postinst/postrm script.
137137
//
138138
// We also only need to do this once per basename, so we don't need to
139-
// itterate over every unit.
139+
// iterate over every unit.
140140

141141
// Get the first key which we'll use to check if the unit is enabled.
142142
// Either all units are enabled or not enabled OR we need to do custom enable

frontend/gateway.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -228,14 +228,14 @@ func Warn(ctx context.Context, client gwclient.Client, st llb.State, msg string)
228228

229229
def, err := st.Marshal(ctx)
230230
if err != nil {
231-
bklog.G(ctx).WithError(err).WithField("warn", msg).Warn("Error marshalling state for outputing warning message")
231+
bklog.G(ctx).WithError(err).WithField("warn", msg).Warn("Error marshalling state for outputting warning message")
232232
}
233233

234234
var dgst digest.Digest
235235
if def != nil {
236236
dgst, err = def.Head()
237237
if err != nil {
238-
bklog.G(ctx).WithError(err).WithField("warn", msg).Warn("Could not get state digest for outputing warning message")
238+
bklog.G(ctx).WithError(err).WithField("warn", msg).Warn("Could not get state digest for outputting warning message")
239239
}
240240
}
241241

frontend/jammy/handle_container.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ func buildImageRootfs(worker llb.State, spec *dalec.Spec, sOpt dalec.SourceOpts,
122122
tmp := llb.Scratch().File(llb.Mkfile("tmp", 0o644, nil))
123123
// Warning: HACK here
124124
// The base ubuntu image has this `excludes` config file which prevents
125-
// installation of a lot of thigns, including doc files.
125+
// installation of a lot of things, including doc files.
126126
// This is mounting over that file with an empty file so that our test suite
127127
// passes (as it is looking at these files).
128128
llb.AddMount("/etc/dpkg/dpkg.cfg.d/excludes", tmp, llb.SourcePath("tmp")).SetRunOption(cfg)

frontend/mux.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ func (m *BuildMux) loadSpec(ctx context.Context, client gwclient.Client) (*dalec
203203
return nil, err
204204
}
205205

206-
// Note: this is not suitable for passing to builds since it does ot have platform information
206+
// Note: this is not suitable for passing to builds since it does not have platform information
207207
spec, err := LoadSpec(ctx, dc, nil)
208208
if err != nil {
209209
return nil, err
@@ -220,7 +220,7 @@ func maybeSetDalecTargetKey(client gwclient.Client, key string) gwclient.Client
220220
return client
221221
}
222222

223-
// optimization to help prevent uneccessary grpc requests
223+
// optimization to help prevent unnecessary grpc requests
224224
// The gateway client will make a grpc request to get the build opts from the gateway.
225225
// This just caches those opts locally.
226226
// If the client is already a clientWithCustomOpts, then the opts are already cached.
@@ -239,7 +239,7 @@ func (m *BuildMux) list(ctx context.Context, client gwclient.Client, target stri
239239
if target == "" {
240240
check = maps.Keys(m.handlers)
241241
} else {
242-
// Use the target as a filter so the response only incldues routes that are underneath the target
242+
// Use the target as a filter so the response only includes routes that are underneath the target
243243
check = append(check, target)
244244
}
245245

@@ -309,7 +309,7 @@ func (m *BuildMux) lookupTarget(ctx context.Context, target string) (matchedPatt
309309
// cases for `t` are as follows:
310310
// 1. may have an exact match in the handlers (ideal)
311311
// 2. No matching handler and `target == ""` and there is a default handler set (assume default handler)
312-
// 3. may have a prefix match in the handlers, e.g. hander for `foo`, `target == "foo/bar"` (assume nested route)
312+
// 3. may have a prefix match in the handlers, e.g. handler for `foo`, `target == "foo/bar"` (assume nested route)
313313
// 4. No match in the handlers (error)
314314
h, ok := m.handlers[target]
315315
if ok {

0 commit comments

Comments
 (0)