ci: add codespell
1. Move codespell config out of Makefile, simplify (remove unused stuff). 2. Fix found issues (using codespell -w). 3. Add a codespell CI job. Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
This commit is contained in:
parent
14d1fce267
commit
cfe8024bff
|
|
@ -180,6 +180,13 @@ gofix_task:
|
||||||
build_script: go fix ./...
|
build_script: go fix ./...
|
||||||
test_script: git diff --exit-code
|
test_script: git diff --exit-code
|
||||||
|
|
||||||
|
codespell_task:
|
||||||
|
alias: codespell
|
||||||
|
container:
|
||||||
|
image: python
|
||||||
|
build_script: pip install codespell
|
||||||
|
test_script: codespell
|
||||||
|
|
||||||
|
|
||||||
# Status aggregator for all tests. This task simply ensures a defined
|
# Status aggregator for all tests. This task simply ensures a defined
|
||||||
# set of tasks all passed, and allows confirming that based on the status
|
# set of tasks all passed, and allows confirming that based on the status
|
||||||
|
|
@ -197,6 +204,7 @@ success_task:
|
||||||
- vendor
|
- vendor
|
||||||
- cross
|
- cross
|
||||||
- gofix
|
- gofix
|
||||||
|
- codespell
|
||||||
container:
|
container:
|
||||||
image: golang:1.21
|
image: golang:1.21
|
||||||
clone_script: 'mkdir -p "$CIRRUS_WORKING_DIR"' # Source code not needed
|
clone_script: 'mkdir -p "$CIRRUS_WORKING_DIR"' # Source code not needed
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,3 @@
|
||||||
|
[codespell]
|
||||||
|
skip = ./.git,./vendor,./tests/tools/vendor,AUTHORS
|
||||||
|
ignore-words-list = afile,flate,prevend,Plack,worl
|
||||||
2
Makefile
2
Makefile
|
|
@ -46,7 +46,7 @@ containers-storage: ## build using gc on the host
|
||||||
$(GO) build -compiler gc $(BUILDFLAGS) ./cmd/containers-storage
|
$(GO) build -compiler gc $(BUILDFLAGS) ./cmd/containers-storage
|
||||||
|
|
||||||
codespell:
|
codespell:
|
||||||
codespell -S Makefile,build,buildah,buildah.spec,imgtype,copy,AUTHORS,bin,vendor,.git,go.sum,CHANGELOG.md,changelog.txt,seccomp.json,.cirrus.yml,"*.xz,*.gz,*.tar,*.tgz,*ico,*.png,*.1,*.5,*.orig,*.rej" -L plack,worl,flate,uint,iff,od,ERRO -w
|
codespell
|
||||||
|
|
||||||
binary local-binary: containers-storage
|
binary local-binary: containers-storage
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -274,7 +274,7 @@ func (c *layersCache) load() error {
|
||||||
var newLayers []*layer
|
var newLayers []*layer
|
||||||
for _, r := range allLayers {
|
for _, r := range allLayers {
|
||||||
// The layer is present in the store and it is already loaded. Attempt to
|
// The layer is present in the store and it is already loaded. Attempt to
|
||||||
// re-use it if mmap'ed.
|
// reuse it if mmap'ed.
|
||||||
if l, found := loadedLayers[r.ID]; found {
|
if l, found := loadedLayers[r.ID]; found {
|
||||||
// If the layer is not marked for re-load, move it to newLayers.
|
// If the layer is not marked for re-load, move it to newLayers.
|
||||||
if !l.reloadWithMmap {
|
if !l.reloadWithMmap {
|
||||||
|
|
|
||||||
|
|
@ -367,7 +367,7 @@ func checkChownErr(err error, name string, uid, gid int) error {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
// Stat contains file states that can be overriden with ContainersOverrideXattr.
|
// Stat contains file states that can be overridden with ContainersOverrideXattr.
|
||||||
type Stat struct {
|
type Stat struct {
|
||||||
IDs IDPair
|
IDs IDPair
|
||||||
Mode os.FileMode
|
Mode os.FileMode
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue