Skip to content

Commit

Permalink
docs: updating contributing guide
Browse files Browse the repository at this point in the history
  • Loading branch information
lotyp committed Apr 11, 2024
1 parent 79a700c commit 04b04cb
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 24 deletions.
28 changes: 12 additions & 16 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,27 +8,19 @@ The latest changes are always in master branch, so please make your Pull Request

## 🚩 Development Requirements

To set up your local development environment, you'll need the following:

- **Operating System**: macOS Monterey+ or Linux.

- Docker Version 26.0.0 or newer. Installation guides:
Before you begin, you will need to set up your local development environment. Here is what you'll need:

- **Operating System**: macOS Monterey+, Linux, or Windows with WSL2.
- **Docker**: Version 26.0.0 or newer. Installation guides:
- [Docker on Ubuntu 22.04](https://www.digitalocean.com/community/tutorials/how-to-install-and-use-docker-on-ubuntu-22-04)
- [Docker Desktop on Mac](https://docs.docker.com/desktop/install/mac-install/)

- **Homebrew** (macOS only): Install via [brew.sh](https://brew.sh/).

- [Pre-commit](https://pre-commit.com)

(Optional): Automates the running of git pre-commit hooks.

- Installation: `brew install pre-commit`

- [Commitizen](https://commitizen-tools.github.io/commitizen/#macos)

(Optional): Assists in formatting git commits.
### → Optional Tools

- [Pre-commit](https://pre-commit.com) — Automates the running of git pre-commit hooks.
- Installation: `brew install pre-commit` and `make hooks`
- [Commitizen](https://commitizen-tools.github.io/commitizen/#macos) — Assists in formatting git commits.
- Installation: `brew install commitizen`

<br>
Expand Down Expand Up @@ -90,6 +82,8 @@ $ make ssh
$ make down
```

By default, phpunit and phpstan commands will be ran against docker environment.

<br>

## ⚡️ Continuous Integration with GitHub Actions
Expand Down Expand Up @@ -161,7 +155,7 @@ $ make lint-composer

We use [`yamllint`](https://github.com/adrienverge/yamllint) to enforce coding standards in YAML files.

If you do not have `yamllint` installed yet, run
(Optional) If you do not have `yamllint` installed yet, run:

```bash
$ brew install yamllint
Expand All @@ -175,6 +169,8 @@ To lint yaml files run:
$ make lint-yaml
```

by default, [`cytopia/yamllint`](https://github.com/cytopia/docker-yamllint) Docker image will be used to run linter.

### → PHP CS Fixer

We use [`friendsofphp/php-cs-fixer`](https://github.com/FriendsOfPHP/PHP-CS-Fixer) together with [`wayofdev/php-cs-fixer-config`](https://github.com/wayofdev/php-cs-fixer-config) to enforce coding standards in PHP files.
Expand Down
14 changes: 6 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,11 @@ BUILDER_WIRED ?= $(BUILDER_PARAMS) --network project.$(COMPOSE_PROJECT_NAME) $(S
# Shorthand envsubst command, executed through build-deps
ENVSUBST ?= $(BUILDER) envsubst

# Commitizen docker image
CZ_RUNNER ?= docker run --rm -it --name commitizen \
--platform linux/amd64 \
--entrypoint /bin/sh \
-v ~/.gitconfig:/root/.gitconfig \
-v $(shell pwd):/app \
commitizen/commitizen:latest
# Yamllint docker image
YAML_LINT_RUNNER ?= docker run --rm $$(tty -s && echo "-it" || echo) \
-v $(PWD):/data \
cytopia/yamllint:latest \
-f colored .

PHIVE_RUNNER ?= $(DOCKER_COMPOSE) run --rm --no-deps app

Expand Down Expand Up @@ -174,7 +172,7 @@ lint: lint-yaml lint-php lint-stan ## Runs all linting commands
.PHONY: lint

lint-yaml: ## Lints yaml files inside project
yamllint .
@$(YAML_LINT_RUNNER)
.PHONY: lint-yaml

lint-php: prepare ## Fixes code to follow coding standards using php-cs-fixer
Expand Down

0 comments on commit 04b04cb

Please sign in to comment.