Skip to content

Commit a74009f

Browse files
authored
Setup repository (#1)
* Init flutter * add lint and dart code metrics * add pull request template * Setup Github PR template and Actions * fix lint * Fix github actions * Fix github actions * Add test to stop complaining
1 parent 5888923 commit a74009f

File tree

9 files changed

+492
-0
lines changed

9 files changed

+492
-0
lines changed

.github/pull_request_template.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#### What does this change?
2+
Describe your changes.
3+
4+
#### How do we test this change?
5+
- [ ] Describe how we can test this change.
6+
7+
#### Any screenshot for this change?
8+
Post any screenshots for your feature, if any.
9+
10+
#### Checklist
11+
- [ ] Run the `pre_pr.sh` script to ensure code quality.

.github/workflows/on_pr.yaml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: On PR check
2+
3+
on: [pull_request]
4+
5+
jobs:
6+
code-check:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- uses: actions/checkout@v3
10+
- uses: subosito/flutter-action@v2
11+
with:
12+
channel: 'stable'
13+
14+
- name: Install dependencies
15+
run: flutter pub get
16+
17+
- name: Check code is formatted
18+
run: |
19+
flutter format lib --output=none --set-exit-if-changed
20+
flutter format test --output=none --set-exit-if-changed
21+
22+
- name: Analyze code
23+
run: flutter analyze --fatal-infos --fatal-warnings
24+
25+
- name: Dart Code Metrics Analysis
26+
run: flutter pub run dart_code_metrics:metrics analyze lib --fatal-style --fatal-warnings --fatal-performance --set-exit-on-violation-level=warning
27+
28+
- name: Run tests
29+
run: flutter test

.gitignore

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
# See https://dart.dev/guides/libraries/private-files
2+
# See https://github.com/github/gitignore/blob/main/Dart.gitignore
3+
4+
# Files and directories created by pub
5+
.dart_tool/
6+
.packages
7+
build/
8+
# If you're building an application, you may want to check-in your pubspec.lock
9+
pubspec.lock
10+
11+
# Directory created by dartdoc
12+
# If you don't generate documentation locally you can remove this line.
13+
doc/api/
14+
15+
# IntelliJ
16+
*.iml
17+
*.ipr
18+
*.iws
19+
.idea/
20+
21+
# Mac
22+
.DS_Store
23+
24+
# dotenv environment variables file
25+
# .env*
26+
27+
# Avoid committing generated Javascript files:
28+
*.dart.js
29+
*.info.json # Produced by the --dump-info flag.
30+
*.js # When generated by dart2js. Don't specify *.js if your
31+
# project includes source files written in JavaScript.
32+
*.js_
33+
*.js.deps
34+
*.js.map
35+
36+
# Miscellaneous
37+
*.class
38+
*.log
39+
*.pyc
40+
*.swp
41+
.atom/
42+
.buildlog/
43+
.history
44+
.svn/
45+
46+
# The .vscode folder contains launch configuration and tasks you configure in
47+
# VS Code which you may wish to be included in version control, so this line
48+
# is commented out by default.
49+
#.vscode/
50+
51+
# Flutter/Dart/Pub related
52+
**/doc/api/
53+
**/ios/Flutter/.last_build_id
54+
**/ios/Podfile.lock
55+
.flutter-plugins
56+
.flutter-plugins-dependencies
57+
.pub-cache/
58+
.pub/
59+
/build/
60+
61+
# Web related
62+
lib/generated_plugin_registrant.dart
63+
64+
# Symbolication related
65+
app.*.symbols
66+
67+
# Obfuscation related
68+
app.*.map.json
69+
70+
# Android Studio will place build artifacts here
71+
/android/app/debug
72+
/android/app/profile
73+
/android/app/release
74+
75+
# code generated by tools
76+
**/generated*/
77+
78+
# for our swagger build script
79+
.build.lock
80+
81+
.git-credentials
82+
83+
**/*.g.*
84+
**/*.freezed.*
85+
**/*.mocks.*
86+
87+
# dart code metrics analytis report
88+
metrics-results/
89+
coverage/
90+
analyzer-output.txt

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
## 0.0.1
2+
3+
* TODO: Describe initial release.

analysis_options.yaml

Lines changed: 276 additions & 0 deletions
Large diffs are not rendered by default.

lib/flutter_force_permission.dart

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
library flutter_force_permission;
2+
3+
/// A Calculator.
4+
class Calculator {
5+
/// Returns [value] plus 1.
6+
int addOne(int value) => value + 1;
7+
}

pre_pr.sh

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#!/bin/bash
2+
# exit on error
3+
set -e
4+
# show debug log
5+
set -x
6+
7+
flutter format lib
8+
flutter format test
9+
flutter analyze --fatal-infos --fatal-warnings
10+
flutter pub run dart_code_metrics:metrics analyze lib --fatal-style --fatal-warnings --fatal-performance --set-exit-on-violation-level=warning
11+
12+
exit 0

pubspec.yaml

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
name: flutter_force_permission
2+
description: A new Flutter package project.
3+
version: 0.0.1
4+
homepage:
5+
6+
environment:
7+
sdk: '>=2.18.4 <3.0.0'
8+
flutter: ">=1.17.0"
9+
10+
dependencies:
11+
flutter:
12+
sdk: flutter
13+
14+
dev_dependencies:
15+
flutter_test:
16+
sdk: flutter
17+
flutter_lints: ^2.0.0
18+
dart_code_metrics: ^5.0.1
19+
20+
# For information on the generic Dart part of this file, see the
21+
# following page: https://dart.dev/tools/pub/pubspec
22+
23+
# The following section is specific to Flutter packages.
24+
flutter:
25+
26+
# To add assets to your package, add an assets section, like this:
27+
# assets:
28+
# - images/a_dot_burr.jpeg
29+
# - images/a_dot_ham.jpeg
30+
#
31+
# For details regarding assets in packages, see
32+
# https://flutter.dev/assets-and-images/#from-packages
33+
#
34+
# An image asset can refer to one or more resolution-specific "variants", see
35+
# https://flutter.dev/assets-and-images/#resolution-aware
36+
37+
# To add custom fonts to your package, add a fonts section here,
38+
# in this "flutter" section. Each entry in this list should have a
39+
# "family" key with the font family name, and a "fonts" key with a
40+
# list giving the asset and other descriptors for the font. For
41+
# example:
42+
# fonts:
43+
# - family: Schyler
44+
# fonts:
45+
# - asset: fonts/Schyler-Regular.ttf
46+
# - asset: fonts/Schyler-Italic.ttf
47+
# style: italic
48+
# - family: Trajan Pro
49+
# fonts:
50+
# - asset: fonts/TrajanPro.ttf
51+
# - asset: fonts/TrajanPro_Bold.ttf
52+
# weight: 700
53+
#
54+
# For details regarding fonts in packages, see
55+
# https://flutter.dev/custom-fonts/#from-packages
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import 'package:flutter_test/flutter_test.dart';
2+
3+
void main() {
4+
group('test', () {
5+
test('test', () {
6+
expect(1, 1);
7+
});
8+
});
9+
}

0 commit comments

Comments
 (0)