Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: add codespell #159

Merged
merged 4 commits into from
Oct 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,3 +45,9 @@ jobs:
uname -a
make test

codespell:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- run: pip install --break-system-packages codespell==v2.3.0
- run: codespell
3 changes: 0 additions & 3 deletions capability/.codespellrc

This file was deleted.

2 changes: 1 addition & 1 deletion capability/enum.go
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ func ListKnown() []Cap {
return list()
}

// ListSupported retuns the list of all capabilities known to the package,
// ListSupported returns the list of all capabilities known to the package,
// except those that are not supported by the currently running Linux kernel.
func ListSupported() ([]Cap, error) {
last, err := LastCap()
Expand Down
6 changes: 2 additions & 4 deletions signal/signal.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,12 @@ import (
)

// CatchAll catches all signals and relays them to the specified channel.
// SIGURG is not handled, as it's used by the Go runtime to support
// preemptable system calls.
// SIGURG is ignored, as it is used by the Go runtime for internal purposes
// (see https://github.com/golang/go/issues/24543).
func CatchAll(sigc chan os.Signal) {
var handledSigs []os.Signal
for n, s := range SignalMap {
if n == "URG" {
// Do not handle SIGURG, as in go1.14+, the go runtime issues
// SIGURG as an interrupt to support preemptable system calls on Linux.
continue
}
handledSigs = append(handledSigs, s)
Expand Down
10 changes: 5 additions & 5 deletions symlink/fs.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,15 +110,15 @@ func evalSymlinksInScope(path, root string) (string, error) {
// into "/b/../c" which then gets filepath.Cleaned into "/c" and then
// root gets prepended and we Clean again (to remove any trailing slash
// if the first Clean gave us just "/")
cleanP := filepath.Clean(string(filepath.Separator) + b.String() + p)
if isDriveOrRoot(cleanP) {
pClean := filepath.Clean(string(filepath.Separator) + b.String() + p)
if isDriveOrRoot(pClean) {
// never Lstat "/" itself, or drive letters on Windows
b.Reset()
continue
}
fullP := filepath.Clean(root + cleanP)
pFull := filepath.Clean(root + pClean)

fi, err := os.Lstat(fullP)
fi, err := os.Lstat(pFull)
if os.IsNotExist(err) {
// if p does not exist, accept it
b.WriteString(p)
Expand All @@ -135,7 +135,7 @@ func evalSymlinksInScope(path, root string) (string, error) {
}

// it's a symlink, put it at the front of path
dest, err := os.Readlink(fullP)
dest, err := os.Readlink(pFull)
if err != nil {
return "", err
}
Expand Down