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

docs: add make help message and update contributing instructions #249

Merged
merged 1 commit into from
Jul 30, 2024
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
21 changes: 11 additions & 10 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,27 +18,28 @@ 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

Use the default make target to execute the full build pipeline. For details on specific targets, refer to the [Makefile](./Makefile).

## 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`.

Expand Down
21 changes: 20 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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"
Comment on lines +64 to +81
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OH, this is nice + helpful. I will say that it will really cut out my RTFSing of makefile time though!

Loading