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

#6614 Add inclusive source scanning #7199

Merged
merged 1 commit into from
Oct 26, 2023
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
22 changes: 22 additions & 0 deletions .github/workflows/woke.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: 'woke'
on:
- pull_request
jobs:
woke:
name: 'woke'
runs-on: ubuntu-latest
steps:
- name: 'Checkout'
uses: actions/checkout@v2

- uses: jitterbit/get-changed-files@v1
id: files

- name: 'woke'
uses: get-woke/woke-action@v0
with:
# Cause the check to fail on any broke rules
fail-on-error: true
# See https://github.com/marketplace/actions/get-all-changed-files
# for more options
woke-args: ${{ steps.files.outputs.added_modified }}
jerop marked this conversation as resolved.
Show resolved Hide resolved
3 changes: 3 additions & 0 deletions .wokeignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
go.mod
go.sum
vendor
5 changes: 5 additions & 0 deletions DEVELOPMENT.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,11 @@ You must install these tools:
> **Note** Linter findings are dependent on your installed Go version. Match
the version in [`go.mod`](go.mod) to match the findings in your PR.

1. (Optional)
[`woke`](https://docs.getwoke.tech/installation/) is executed for every pull
request. To ensure your work does not contain offensive language, you may
want to install and run this tool locally.

### Configure environment

To [build, deploy and run your Tekton Objects with `ko`](#install-pipeline), you'll need to set these environment variables:
Expand Down
10 changes: 10 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,10 @@ TESTPKGS = $(shell env GO111MODULE=on $(GO) list -f \
'{{ if or .TestGoFiles .XTestGoFiles }}{{ .ImportPath }}{{ end }}' \
$(PKGS))
BIN = $(CURDIR)/.bin
WOKE ?= go run -modfile go.mod github.com/get-woke/woke

GOLANGCI_VERSION = v1.52.2
WOKE_VERSION = v0.19.0

GO = go
TIMEOUT_UNIT = 5m
Expand Down Expand Up @@ -185,6 +187,14 @@ goimports: | $(GOIMPORTS) ; $(info $(M) running goimports…) ## Run goimports
fmt: ; $(info $(M) running gofmt…) @ ## Run gofmt on all source files
$Q $(GO) fmt $(PKGS)

WOKE = $(BIN)/woke
$(BIN)/woke: ; $(info $(M) getting woke $(WOKE_VERSION))
cd tools; GOBIN=$(BIN) go install github.com/get-woke/woke@$(WOKE_VERSION)

.PHONY: woke
woke: | $(WOKE) ; $(info $(M) running woke...) @ ## Run woke
$Q $(WOKE) -c https://github.com/canonical/Inclusive-naming/raw/main/config.yml

# Misc

.PHONY: clean
Expand Down
Loading