Skip to content

Commit

Permalink
Merge branch 'develop' into feature/launch_url_with_toast
Browse files Browse the repository at this point in the history
  • Loading branch information
rubuy-74 authored Jul 27, 2023
2 parents a9050f2 + a2a53aa commit edaba7b
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/format_lint_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
with:
flutter-version: ${{ env.FLUTTER_VERSION }}

- run: dart format . --set-exit-if-changed
- run: dart format $(find . -type f -name "*.dart" -a -not -name "*.g.dart") --set-exit-if-changed

lint:
name: 'Lint'
Expand Down
15 changes: 15 additions & 0 deletions pre-commit-hook.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/bin/sh
mkdir -p .git/hooks #it seems that are some cases where git will not create a hook directory if someone removed the hook templates
tee .git/hooks/pre-commit << EOF
#!/bin/sh
FILES="\$(git diff --name-only --cached | grep .*\.dart | grep -v .*\.g\.dart)"
[ -z "\$FILES" ] && exit 0
echo "\$FILES" | xargs dart format
echo "\$FILES" | xargs git add
EOF

chmod +x .git/hooks/pre-commit
16 changes: 15 additions & 1 deletion uni/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,20 @@ The token is read from the file assets/env/env.json, which you may need to creat
}
```

### Automated formatting

In order to contribute, you must format your changed files using `dart format` manually or enabing _formatting on save_ using your IDE ([VSCode or IntelliJ](https://docs.flutter.dev/tools/formatting)). Alternatively, you can install the git pre-commit hook that formats your changed files when you commit, doing the following command at the **root directory of the repository**:

``` bash
chmod +x pre-commit-hook.sh && ./pre-commit-hook.sh
```

In order to remove it, is it as simple as running the following command, from the **root directory of the repository**:

```bash
rm .git/hooks/pre-commit
```

## Project structure

### Overview
Expand All @@ -36,4 +50,4 @@ The *view* part of the app is made of *widgets* (stateful or stateless). They ea
### Controller

The *controller* directory contains all artifacts that are not directly related to the view or the model. This includes the parsers, the networking code, the database code and the logic that handles the global state of the app.
The *controller* directory contains all artifacts that are not directly related to the view or the model. This includes the parsers, the networking code, the database code and the logic that handles the global state of the app.
2 changes: 1 addition & 1 deletion uni/app_version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.5.43+161
1.5.44+162
2 changes: 1 addition & 1 deletion uni/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev
# To change it manually, override the value in app_version.txt.
# The app version code is automatically also bumped by CI.
# Do not change it manually.
version: 1.5.43+161
version: 1.5.44+162

environment:
sdk: ">=2.17.1 <3.0.0"
Expand Down

0 comments on commit edaba7b

Please sign in to comment.