Skip to content

Commit

Permalink
TEP-6614 Add inclusive source scanning
Browse files Browse the repository at this point in the history
  • Loading branch information
prestonvasquez committed Oct 11, 2023
1 parent 3ad2f65 commit c12e347
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 0 deletions.
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 }}
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
11 changes: 11 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 All @@ -202,3 +212,4 @@ help:
version:

@echo $(VERSION)

0 comments on commit c12e347

Please sign in to comment.