TheRealSpectrum / four-horsemen-restaurant

Repository will be renamed when the team name and project name have been determined
0 stars 2 forks source link

Four Horsemen: Restaurant App

Lint

Quick setup

composer install

# sail is an alias to './vendor/bin/sail'. Use the quoted name instead if you don't know what that means.
sail up # add '-d' if you want to keep control of your terminal
sail artisan key:generate
sail artisan migrate:fresh --seed

Linting

This project uses eslint and prettier to check for problems and enforce code style. VsCode has the prettier extension which can automatically format the document on save. It is highly recommended to use this plugin when using vscode.

Included in the repository is a pre-commit git hook. This will automatically run both linters before commiting. To use the hook run the following command:

git config core.hooksPath .githooks

Note: This will use docker to run the commands. Make sure you ran sail up before commiting anything.

Git

features

Features are implemented using a few steps:

  1. Pull the lates version of main.
  2. Create a new branch with the format patch-{name}-{feature}.
  3. Write your changes with multiple commits.
  4. Try to merge the main branch.
  5. Create and merge a Pull Request on github.

Example:

# Pull latest version of main
git pull

# Create new branch
git switch -C patch-damymetzke-add-recipe-model

# Make changes
git commit -m "Write recipe model"
git commit -m "Write relations for recipe model"
git commit -m "Write unit test for recipe model"
git commit -m "Document recipe model"

# Merge main
git pull origin main
git merge main -m "Merge main into feature"

# The following commands are executed using the github cli tool. These steps also be taken graphically on github.com

# Create pull request
gh pr create

# merge pull request (number should be displayed as ouput of previous command)
gh pr merge 42

There are a few important rules:

Commits

Example of valid commit message:

Add `Recipe` model

Quick implementation for #52, Must be completed later.