diff --git a/.gitattributes b/.gitattributes index 7e975a8c8..8d6d033a4 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,4 +1,11 @@ +# Line-endings behavior +* text=auto + +# Git lfs *.jpg filter=lfs diff=lfs merge=lfs -text *.png filter=lfs diff=lfs merge=lfs -text *.jpeg filter=lfs diff=lfs merge=lfs -text *.mp4 filter=lfs diff=lfs merge=lfs -text +*.mov filter=lfs diff=lfs merge=lfs -text +*.pdf filter=lfs diff=lfs merge=lfs -text + diff --git a/.vscode/settings.json b/.vscode/settings.json index 2eea6a1ee..6b6717aae 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -6,5 +6,7 @@ "watch": false, "onSave": "test-src-file", "onStartup": ["all-tests"] - } + }, + "editor.formatOnSave": true, + "editor.defaultFormatter": "esbenp.prettier-vscode" } diff --git a/README.md b/README.md index 8933a7a1b..a7b0b82c6 100644 --- a/README.md +++ b/README.md @@ -8,10 +8,12 @@ The (internal) project-board is [here](https://github.com/orgs/hpi-sam/projects/ ## Installation -1. Install [NodeJs](https://nodejs.org/) (at least version 16.x) (if you need different node versions on your machine we recommend [nvm](https://github.com/nvm-sh/nvm) or [nvm for windows](https://github.com/coreybutler/nvm-windows)) -2. [npm](https://www.npmjs.com/) should already come with NodeJs - if not install it -3. Clone this repository -4. Run `npm run setup` from the root folder +1. Make sure to have [git lfs](https://git-lfs.github.com/) installed. +2. Install [NodeJs](https://nodejs.org/) (at least version 16.x) (if you need different node versions on your machine we recommend [nvm](https://github.com/nvm-sh/nvm) or [nvm for windows](https://github.com/coreybutler/nvm-windows)) +3. [npm](https://www.npmjs.com/) should already come with NodeJs - if not install it +4. Clone this repository +5. Run `npm run setup` from the root folder +6. (Optional) We have a list of recommended [vscode](https://code.visualstudio.com/) extensions. We strongly recommend you to use them if you are developing. You can see them via [the `@recommended` filter in the extensions panel](https://code.visualstudio.com/docs/editor/extension-marketplace#_recommended-extensions). ## Starting for development @@ -25,6 +27,13 @@ If you are using [vscode](https://code.visualstudio.com/), you can run the [task 2. Open another terminal in `/frontend` and run `npm run start` 3. Open another terminal in `/backend` and run `npm run start` +## Before you commit + +- We are using [git lfs](https://git-lfs.github.com/). You can see the file types that currently use git lfs in [.gitattributes](.gitattributes). If you add another binary (or very large) file type to the repository you should add it there too. +- To see the images stored in [git lfs](https://git-lfs.github.com/) in diff views in vscode we recommend running the following command once: `git config diff.lfs.textconv cat`. +- We are using [prettier](https://prettier.io/) as our code formatter. Run it via `npm run prettier` in the root to format all files and make the CI happy. Please use the [vscode extension](https://marketplace.visualstudio.com/items?itemName=esbenp.prettier-vscode). +- We are using [eslint](https://eslint.org/) as our linter. Run it via `npm run lint:fix` in the root to lint (and auto fix if possible) all files. Please use the [vscode extension](https://marketplace.visualstudio.com/items?itemName=dbaeumer.vscode-eslint). + ## Debugging There are already the following [debug configurations](https://code.visualstudio.com/docs/editor/debugging) for vscode saved: