Skip to content

Commit

Permalink
docs: update contributing guide (#2586)
Browse files Browse the repository at this point in the history
* chore: update make targets

* docd: update contributing guides with go.mod and lint work

* docs: wording
  • Loading branch information
mdelapenya committed Jun 14, 2024
1 parent 2681ae4 commit dd7d7a9
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci-test-go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ jobs:

- name: modTidy
working-directory: ./${{ inputs.project-directory }}
run: make tools-tidy
run: make tidy

- name: ensure compilation
working-directory: ./${{ inputs.project-directory }}
Expand Down
7 changes: 4 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,13 @@ test-all: tools test-tools test-unit
.PHONY: test-examples
test-examples:
@echo "Running example tests..."
make -C examples test
$(MAKE) -C examples test

.PHONY: tidy-all
tidy-all:
make -C examples tidy-examples
make -C modules tidy-modules
$(MAKE) tidy
$(MAKE) -C examples tidy-examples
$(MAKE) -C modules tidy-modules

## -------------------------------------

Expand Down
4 changes: 2 additions & 2 deletions commons-test.mk
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,6 @@ tools:
.PHONY: test-tools
test-tools: $(GOBIN)/gotestsum

.PHONY: tools-tidy
tools-tidy:
.PHONY: tidy
tidy:
go mod tidy
6 changes: 5 additions & 1 deletion docs/contributing.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,9 @@
* follow the style, naming and structure conventions of the rest of the project.
* make commits atomic and easy to merge.
* when updating documentation, please see [our guidance for documentation contributions](contributing_docs.md).
* apply format running `go fmt`, or the shell script `./scripts/checks.sh`
* when updating the `go.mod` file, please run `make tidy-all` to ensure all modules are updated. It will run `golangci-lint` with the configuration set in the root directory of the project. Please be aware that the lint stage could fail if this is not done.
* apply format running `make lint`
* For examples: `make -C examples lint`
* For modules: `make -C modules lint`
* verify all tests are passing. Build and test the project with `make test-all` to do this.
* For a given module or example, go to the module or example directory and run `make test`.
2 changes: 1 addition & 1 deletion examples/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ lint-examples:

.PHONY: tidy-examples
tidy-examples:
@find . -type f -name Makefile -execdir make tools-tidy \;
@find . -type f -name Makefile -execdir make tidy \;
2 changes: 1 addition & 1 deletion modules/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ lint-modules:

.PHONY: tidy-modules
tidy-modules:
@find . -type f -name Makefile -execdir make tools-tidy \;
@find . -type f -name Makefile -execdir make tidy \;

0 comments on commit dd7d7a9

Please sign in to comment.