From 072d22ab56d1482ab50cda0dd62b4ac137240d2a Mon Sep 17 00:00:00 2001 From: Maximilian Mitchell Date: Fri, 2 Apr 2021 18:07:43 +0100 Subject: [PATCH] Tidy README and add comments to pre-commit.sh --- README.md | 54 ++++++++++++++++++++++++++++++++------------------- pre-commit.sh | 4 +++- 2 files changed, 37 insertions(+), 21 deletions(-) mode change 100644 => 100755 pre-commit.sh diff --git a/README.md b/README.md index 7b56c8df..f278b4a9 100644 --- a/README.md +++ b/README.md @@ -3,46 +3,60 @@ # [notifi.it](https://notifi.it/) ## App | [Website](https://github.com/maxisme/notifi.it) | [Backend](https://github.com/maxisme/notifi-backend) + [![style: lint](https://img.shields.io/badge/lint-flutter-4BC0F5)](https://pub.dev/packages/lint) [![MacOS](https://github.com/maxisme/notifi/actions/workflows/push.yml/badge.svg?branch=master)](https://github.com/maxisme/notifi/actions/workflows/push.yml) -# install -``` + +# Install Flutter + +https://flutter.dev/docs/get-started/install + +## MacOS build & run + +```bash flutter channel master flutter upgrade sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer sudo xcodebuild -runFirstLaunch flutter doctor -``` -## mac -``` flutter build macos flutter run -d macos ``` -## [install flutter](https://flutter.dev/docs/get-started/install) +## Tests + +### Lint & Test -## creating sqlite.so +```bash +bash ./pre-commit.sh ``` -gcc -c -Wall -Werror -fpic sqlite3.c -gcc -shared -o sqlite3.so sqlite3.o + +### Set screenshot asserts + +``` +flutter test --update-goldens +``` + +## Extras + +### Add pre-commit hook + +```bash +ln -s $(pwd)/pre-commit.sh $(pwd)/.git/hooks/pre-commit +chmod +x $(pwd)/.git/hooks/pre-commit ``` ### Jetbrains flutter plugin: + https://plugins.jetbrains.com/plugin/9212-flutter/versions -## db path +### Db path + ~/Library/Containers/uk.me.max.notifi/Data/Documents/notifications.db -## gh .env secrets +### GH .env secret to base64 string + cat .env | openssl base64 -## set screenshot asserts -``` -flutter test --update-goldens -``` -## pre-commit hook -```bash -cp pre-commit.sh .git/hooks/pre-commit -chmod +x .git/hooks/pre-commit -``` + diff --git a/pre-commit.sh b/pre-commit.sh old mode 100644 new mode 100755 index 96620600..db9b7f84 --- a/pre-commit.sh +++ b/pre-commit.sh @@ -1,15 +1,17 @@ #!/bin/bash +# format if ! flutter format lib --set-exit-if-changed; then exit 1 fi - if ! flutter format test --set-exit-if-changed; then exit 1 fi +# run lint if ! flutter analyze; then exit 1 fi +# run tests flutter test \ No newline at end of file