Skip to content

Commit

Permalink
Merge pull request #159 from kolyshkin/codespell
Browse files Browse the repository at this point in the history
ci: add codespell
  • Loading branch information
kolyshkin authored Oct 30, 2024
2 parents f261e83 + c6af1fb commit 4e88a80
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 13 deletions.
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

0 comments on commit 4e88a80

Please sign in to comment.