From 36de770ae428a8ddb5b2c84e5bd21058d9a0a570 Mon Sep 17 00:00:00 2001 From: tdstein Date: Mon, 29 Jul 2024 10:32:59 -0400 Subject: [PATCH] docs: update contributing instructions and add help command to makefile --- CONTRIBUTING.md | 21 +++++++++++---------- Makefile | 21 ++++++++++++++++++++- 2 files changed, 31 insertions(+), 11 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 1a71d3cf..df4df8b7 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -18,13 +18,12 @@ Before contributing to the `posit-sdk`, ensure that the following prerequisites > [!WARNING] > Executing `make` will utilize `pip` to install third-party packages in your activated Python environment. Please review the [`Makefile`](./Makefile) to verify behavior before executing any commands. -1. Fork the repository and clone it to your local machine. -1. Create a new branch for your feature or bug fix. -1. Run `make` to run the default development workflow. -1. Make your changes and test them thoroughly using `make test` -1. Run `make fmt` and `make lint` to verify adherence to the project style guide. -1. Commit your changes and push them to your forked repository. -1. Submit a pull request to the main repository. +1. Fork the repository and open it in your development environment. +2. Run `make` to run the default development workflow. +3. Make your changes and test them thoroughly using `make test` +4. Run `make fmt` and `make lint` to verify adherence to the project style guide. +5. Commit your changes and push them to your forked repository. +6. Submit a pull request to the main repository. ## Tooling @@ -32,13 +31,15 @@ Use the default make target to execute the full build pipeline. For details on s ## Style Guide -We use [Ruff](https://docs.astral.sh/ruff/) for linting and code formatting. All proposed changes must successfully pass the `make lint` rules prior to merging. +We use [Ruff](https://docs.astral.sh/ruff/) for linting and code formatting. Run `make deps` to install it. -Utilize `make fmt lint fix` to format and lint your changes. +All proposed changes must successfully pass the `make lint` rules prior to merging. + +Utilize `make fmt lint` to format and lint your changes. ### (Optional) pre-commit -This project is configured for [pre-commit](https://pre-commit.com). Once enabled, a `git commit` hook is created, which invokes `make fmt lint fix`. +This project is configured for [pre-commit](https://pre-commit.com). Once enabled, a `git commit` hook is created, which invokes `make fmt lint`. To enable pre-commit on your machine, run `pre-commit install`. diff --git a/Makefile b/Makefile index 3191f435..807b5194 100644 --- a/Makefile +++ b/Makefile @@ -2,7 +2,7 @@ include vars.mk .DEFAULT_GOAL := all -.PHONY: build clean cov default deps dev docs fmt fix install it lint test uninstall version +.PHONY: build clean cov default deps dev docs fmt fix install it lint test uninstall version help all: deps dev test lint build @@ -60,3 +60,22 @@ uninstall: version: @$(PYTHON) -m setuptools_scm + +help: + @echo "Makefile Targets" + @echo " all Run deps, dev, test, lint, and build" + @echo " build Build the project" + @echo " clean Clean up project artifacts" + @echo " cov Generate a coverage report" + @echo " cov-html Generate an HTML coverage report and open it" + @echo " cov-xml Generate an XML coverage report" + @echo " deps Install dependencies" + @echo " dev Install the project in editable mode" + @echo " docs Build the documentation" + @echo " fmt Format the code" + @echo " install Install the built project" + @echo " it Run integration tests" + @echo " lint Lint the code" + @echo " test Run unit tests with coverage" + @echo " uninstall Uninstall the project" + @echo " version Display the project version"