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

Nested .wokeignore doesn't work in a git repo. #212

Open
2 tasks done
cburgess opened this issue Jun 28, 2022 · 2 comments
Open
2 tasks done

Nested .wokeignore doesn't work in a git repo. #212

cburgess opened this issue Jun 28, 2022 · 2 comments
Labels
bug Something isn't working

Comments

@cburgess
Copy link

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 0.18.2
Config file

No config file.

Go environment
$ go version && go env
cfb@sandman:dir1/> go version && go env
go version go1.18.3 darwin/amd64
GO111MODULE=""
GOARCH="amd64"
GOBIN=""
GOCACHE="/Users/cfb/Library/Caches/go-build"
GOENV="/Users/cfb/Library/Application Support/go/env"
GOEXE=""
GOEXPERIMENT=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOINSECURE=""
GOMODCACHE="/Users/cfb/go/pkg/mod"
GONOPROXY=""
GONOSUMDB=""
GOOS="darwin"
GOPATH="/Users/cfb/go"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/usr/local/opt/go/libexec"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/local/opt/go/libexec/pkg/tool/darwin_amd64"
GOVCS=""
GOVERSION="go1.18.3"
GCCGO="gccgo"
GOAMD64="v1"
AR="ar"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD="/dev/null"
GOWORK=""
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/9t/4dv6njks73b3x3krqm3fxxnm0000gn/T/go-build277855627=/tmp/go-build -gno-record-gcc-switches -fno-common"

if I create a simple directory structure with a nested .wokeignore file then everything works as expected.

Example:

cfb@sandman:woke/> find .
.
./dir1
./dir1/dir2
./dir1/dir2/slave
./dir1/.wokeignore
cfb@sandman:woke/> cat dir1/.wokeignore
dir2/*
cfb@sandman:woke/> woke
No findings found.
cfb@sandman:woke/> cd dir1/
cfb@sandman:dir1/> woke
No findings found.

However if I do the same thing in a git repo, the nested .wokeignore file is not processed unless I'm in the root of the git checkout.

Example:

cfb@sandman:woke/> git init
hint: Using 'master' as the name for the initial branch. This default branch name
hint: is subject to change. To configure the initial branch name to use in all
hint: of your new repositories, which will suppress this warning, call:
hint:
hint: 	git config --global init.defaultBranch <name>
hint:
hint: Names commonly chosen instead of 'master' are 'main', 'trunk' and
hint: 'development'. The just-created branch can be renamed via this command:
hint:
hint: 	git branch -m <name>
Initialized empty Git repository in /private/tmp/woke/.git/
cfb@sandman:woke/>
cfb@sandman:woke/>
cfb@sandman:woke/> find .
.
./dir1
./dir1/dir2
./dir1/dir2/slave
./dir1/.wokeignore
./.git
./.git/config
./.git/objects
./.git/objects/pack
./.git/objects/info
./.git/HEAD
./.git/info
./.git/info/exclude
./.git/description
./.git/hooks
./.git/hooks/commit-msg.sample
./.git/hooks/pre-rebase.sample
./.git/hooks/pre-commit.sample
./.git/hooks/applypatch-msg.sample
./.git/hooks/fsmonitor-watchman.sample
./.git/hooks/pre-receive.sample
./.git/hooks/prepare-commit-msg.sample
./.git/hooks/post-update.sample
./.git/hooks/pre-merge-commit.sample
./.git/hooks/pre-applypatch.sample
./.git/hooks/pre-push.sample
./.git/hooks/update.sample
./.git/hooks/push-to-checkout.sample
./.git/refs
./.git/refs/heads
./.git/refs/tags
cfb@sandman:woke/> woke
No findings found.
cfb@sandman:woke/> cd dir1/
cfb@sandman:dir1/> woke
dir2/slave:1:1-1: Filename finding: `slave` may be insensitive, use `follower`, `replica`, `standby` instead (error)
@cburgess cburgess added the bug Something isn't working label Jun 28, 2022
@github-actions
Copy link
Contributor

👋 Thanks for submitting your first issue!

Please be sure to read and follow our Code of Conduct and Contributing guide.

⭐️ Is your org or open source project using woke? If so, we'd love for you to be included in the 'Who uses woke' list at https://github.com/get-woke/woke/blob/main/docs/about.md#who-uses-woke.

@cburgess
Copy link
Author

It also look like in this case the .wokeignore file is also being processed for violations.

Example:

cfb@sandman:base-apps/> woke | grep -i black
.wokeignore:2:4-13: `blacklist` may be insensitive, use `denylist`, `blocklist`, `exclusion list` instead (warning)
tag-blacklist.txt

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

No branches or pull requests

1 participant