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

Woke doesn't account for .git/info/excludes #102

Closed
2 tasks done
ollien opened this issue Jul 15, 2021 · 2 comments · Fixed by #106
Closed
2 tasks done

Woke doesn't account for .git/info/excludes #102

ollien opened this issue Jul 15, 2021 · 2 comments · Fixed by #106
Labels
bug Something isn't working

Comments

@ollien
Copy link

ollien commented Jul 15, 2021

Thank you for creating the issue!

  • Yes, I've searched similar issues on GitHub and didn't find any.
  • Yes, I've included all information below (version, config, etc).

Please include the following information:

Version of woke
$ woke --version
# woke version main

(it's 0.9.3 though)

Config file Default
Go environment
$ go version && go env
go version go1.16.5 darwin/amd64
GO111MODULE=""
GOARCH="amd64"
GOBIN=""
GOCACHE="/Users/nkrichevsky/Library/Caches/go-build"
GOENV="/Users/nkrichevsky/Library/Application Support/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOINSECURE=""
GOMODCACHE="/Users/nkrichevsky/go/pkg/mod"
GONOPROXY=""
GONOSUMDB=""
GOOS="darwin"
GOPATH="/Users/nkrichevsky/go"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/usr/local/Cellar/go/1.16.5/libexec"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/local/Cellar/go/1.16.5/libexec/pkg/tool/darwin_amd64"
GOVCS=""
GOVERSION="go1.16.5"
GCCGO="gccgo"
AR="ar"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD="/dev/null"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -arch x86_64 -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/gj/6g23qq697ddc5mx6ry8ypdy80000gp/T/go-build1660822404=/tmp/go-build -gno-record-gcc-switches -fno-common"
Verbose output of running
$ ~/go/bin/woke --debug
2021-07-15T18:58:17-04:00 DBG woke version main built from 000000 on today
2021-07-15T18:58:17-04:00 DBG rules enabled rules=["whitelist","blacklist","master-slave","slave","grandfathered","man-hours","sanity","dummy","guys","whitebox","blackbox"]
2021-07-15T18:58:17-04:00 DBG skipping ignorefile error="open .gitignore: no such file or directory" file=.gitignore
2021-07-15T18:58:17-04:00 DBG skipping ignorefile error="open .wokeignore: no such file or directory" file=.wokeignore
2021-07-15T18:58:17-04:00 DBG finished compiling ignores durationMS=0.446858
2021-07-15T18:58:17-04:00 DBG created new printer printer=text
2021-07-15T18:58:17-04:00 DBG process files path=. type=parallel
2021-07-15T18:58:17-04:00 DBG finished processing findings durationMS=0.239601 file=ignoreme
2021-07-15T18:58:17-04:00 DBG skipping content file=. reason="file is a directory"
2021-07-15T18:58:17-04:00 DBG finished processing findings durationMS=0.671263 file=.
ignoreme:1:0-9: `whitelist` may be insensitive, use `allowlist`, `inclusion list` instead (warning)
whitelist
^
2021-07-15T18:58:17-04:00 DBG woke completed durationMS=4.136938

I use .git/info/exclude to exclude files that don't belong in .gitignore (i.e. that the rest of my team doesn't need to worry about). However, woke does not respect this.

[~/Documents/code/test] nkrichevsky@nkrichevsky-mbp$ cat .git/info/exclude
# git ls-files --others --exclude-from=.git/info/exclude
# Lines that start with '#' are comments.
# For a project mostly in C, the following would be a good set of
# exclude patterns (uncomment them if you want to use them):
# *.[oa]
# *~
ignoreme
[~/Documents/code/test] nkrichevsky@nkrichevsky-mbp$ ~/go/bin/woke
ignoreme:1:0-9: `whitelist` may be insensitive, use `allowlist`, `inclusion list` instead (warning)
whitelist
^
@ollien ollien added the bug Something isn't working label Jul 15, 2021
@caitlinelfring
Copy link
Member

I think this might be as simple as adding lines = append(lines, readIgnoreFile(".git/info/exclude")...) after https://github.com/get-woke/woke/blob/main/pkg/ignore/ignore.go#L30

@caitlinelfring
Copy link
Member

Fix added in #106

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants