Skip to content

Commit 10017cf

Browse files
committed
Update templates.
1 parent b7c0d7c commit 10017cf

34 files changed

Lines changed: 2838 additions & 64 deletions

.githooks/README.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
The git hooks are located in a non-standard place (other than
2+
.git/hooks) so that they can be added to github. Seems like files in
3+
.git can not be added to github.
4+
5+
To enable the hooks in here to be run by git, ensure you first run:
6+
7+
git config core.hooksPath .githooks
8+
9+
To check the current path:
10+
11+
git config core.hooksPath
12+
13+
And to unset the variable:
14+
15+
git config --unset core.hooksPath
16+
17+
The default folder for githooks is .git/hooks.
18+
19+
20250627 gjw

.githooks/pre-commit

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
#!/usr/bin/env bash
2+
3+
# Dart Format
4+
5+
printf "\e[33;1m%s\e[0m\n" 'Running dart format.'
6+
7+
result=$(dart format lib)
8+
result_lines=$(echo "$result" | wc -l)
9+
10+
if [ "$result_lines" -gt 1 ]; then
11+
echo "$result"
12+
printf "\e[31;1m%s\e[0m\n" 'Dart format applied changes, please commit again.'
13+
exit 1
14+
fi
15+
16+
echo "$result"
17+
printf "\e[32;1m%s\e[0m\n" 'Finished running dart format.'
18+
19+
# Get the commit message.
20+
21+
COMMIT_MSG=$(git log -1 --pretty=%B)
22+
23+
# 20260123 gjw Check if the commit message starts with 'Bump version'
24+
# If it does then run `make versions` to update the version in any
25+
# files that require updating, based on the version from pubspec.yaml.
26+
# Then add any updated files to the commit. I add specific files
27+
# rather than using `.` just to avoid possibly adding things I was not
28+
# planning to. This way we always update, for example, the snap
29+
# version when we 'Bump version', avoiding missing this step, so the
30+
# installer builds that 'Bump version' triggers will get the correct
31+
# versions.
32+
33+
if [[ $COMMIT_MSG == Bump\ version* ]]; then
34+
printf "\e[33;1m%s\e[0m\n" 'Update versions.'
35+
36+
make versions
37+
git add snap/snapcraft.yaml
38+
39+
printf "\e[32;1m%s\e[0m\n" 'Finished updating versions.'
40+
41+
fi

.githooks/pre-push

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
#!/usr/bin/env bash
2+
3+
# Verify what is about to be pushed.
4+
#
5+
# Called by "git push" after it has checked the remote status, but
6+
# before anything has been pushed.
7+
#
8+
# If this script exits with a non-zero status nothing will be pushed.
9+
10+
# Flutter Analyze
11+
12+
printf "\e[33;1m%s\e[0m\n" 'Running flutter analyze.'
13+
14+
result=$(flutter analyze lib)
15+
16+
if [ $? -ne 0 ]; then
17+
echo -e "$result \n"
18+
printf "\e[31;1m%s\e[0m\n" 'Flutter analyze found the above issues, please fix, commit and push again.'
19+
exit 1
20+
fi
21+
22+
echo "$result"
23+
24+
# Check the version is updated before we can push!
25+
26+
PVER=$(egrep '^version:' pubspec.yaml | cut -d' ' -f2 | cut -d'+' -f1)
27+
28+
if [ -d snap ]; then
29+
SVER=$(egrep '^version:' snap/snapcraft.yaml | cut -d' ' -f2 | cut -d'+' -f1)
30+
31+
if [ "${PVER}" != "${SVER}" ]; then
32+
printf "\e[31;1m%s\e[0m\n" "Version mismatch pubspec.yaml (${PVER}) and snap/snapcraft.yaml (${SVER})."
33+
echo 'Run `make versions` and then commit.'
34+
exit 2
35+
fi
36+
fi
37+
38+
printf "\e[32;1m%s\e[0m\n" "Finished running Flutter analyze with 0 issues and found Version ${PVER}."

.github/ISSUE_TEMPLATE/bug_report.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
name: 'bug report'
3-
about: Create a bug report to help improve FilePod.
3+
about: Create a bug report to help improve Rattle.
44
title: ''
55
labels: ''
66
assignees: ''
@@ -13,7 +13,7 @@ assignees: ''
1313

1414
## To Reproduce
1515

16-
Steps to reproduce the behaviour:
16+
Steps to reproduce the behavior:
1717

1818
1. Go to '...'
1919
2. Click on '....'

.github/ISSUE_TEMPLATE/feature_request.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
name: 'feature request'
3-
about: Suggest an idea or feature improvement for FilePod.
3+
about: Suggest an idea or feature improvement for this project.
44
title: ''
55
labels: ''
66
assignees: ''

.github/pull_request_template.md

100644100755
Lines changed: 14 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,25 @@
1-
# Pull Request Details
1+
## Pull Request Details
22

3-
## What issue does this PR address
3+
### Description
4+
<!--- Describe the problem this PR solves -->
5+
<!--- Describe what you have changed -->
6+
<!--- Describe why this change is required -->
47

5-
- [Description]
8+
### Related Issues
9+
<!--- If it fixes an open issue(s), please link to the issue here. -->
610

7-
## Associated Issue
8-
9-
- This PR relates to issue #
10-
11-
## Type of Change
11+
### Type of Change
1212

1313
- [ ] Bug fix (non-breaking change which fixes an issue)
1414
- [ ] New feature (non-breaking change which adds functionality)
1515
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
1616
- [ ] This change requires a documentation update
1717

18-
## How Has This Been Tested?
19-
20-
Please describe the tests that you ran to verify your changes.
18+
### How To Test?
19+
<!--- Describe the tests that a reviewer can undertake to verify your changes. -->
2120

22-
## Checklist
23-
24-
Complete the check-list below to ensure your branch is ready for PR.
21+
### Checklist
22+
<!--- Go over all the following points, and put an `x` in all the boxes that apply. -->
2523

2624
- [ ] Screenshots included in linked issue #
2725
- [ ] Changes adhere to the [style and coding guidelines](https://survivor.togaware.com/gnulinux/flutter-style.html)
@@ -43,9 +41,8 @@ Complete the check-list below to ensure your branch is ready for PR.
4341
- [ ] I have identified reviewers
4442
- [ ] The PR has been approved by reviewers
4543

46-
## Finalising
47-
48-
Once PR discussion is complete and reviewers have approved:
44+
### Finalising
45+
<!--- Once PR discussion is complete and reviewers have approved. -->
4946

5047
- [ ] Merge dev into the this branch
5148
- [ ] Resolve any conflicts

.github/workflows/ci.yaml

Lines changed: 70 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,19 @@
11
name: Lint Checks
22

3+
# Always run the checks on a push and a PR.
4+
#
5+
# 20250914 gjw Run the tests as separate jobs so we see the individual
6+
# results. We can instead run then as a single job with multiple
7+
# steps, but then it stops on the first fail and so not as
8+
# informative.
9+
310
on:
411
push:
512
pull_request:
613
types: [opened, reopened, synchronize]
714

815
env:
9-
FLUTTER_VERSION: '3.38.9'
16+
FLUTTER_VERSION: '3.41.5'
1017

1118
jobs:
1219

@@ -82,26 +89,41 @@ jobs:
8289
with:
8390
node-version: 18
8491
- run: npm install -g markdownlint-cli
85-
- run: markdownlint *.md lib assets
92+
- run: markdownlint *.md lib assets installers
8693

8794
link_checker:
8895
runs-on: ubuntu-latest
8996
if: github.event.repository.private == false
9097
permissions:
91-
issues: write
98+
issues: write # required for peter-evans/create-issue-from-file
9299
steps:
93100
- uses: actions/checkout@v4
94101

95102
- name: Link Checker
96103
id: lychee
97104
uses: lycheeverse/lychee-action@v2
98-
with:
105+
with: # Don't fail for now but then create an issue - useful?
99106
args:
107+
--exclude-file .lycheeignore
100108
--no-progress
101109
'*.md'
102110
'./**/*.dart'
111+
'assets/**/*.md'
112+
'assets/**/*.html'
103113
fail: true
104114

115+
# 20251030 gjw Remove the automatic creation of an issue for
116+
# now. It is creating too many and I am simply closing them. The
117+
# failure of the lint test itself should be enough.
118+
119+
# - name: Create Issue From File
120+
# if: steps.lychee.outputs.exit_code != 0
121+
# uses: peter-evans/create-issue-from-file@v5
122+
# with:
123+
# title: Link Checker Report
124+
# content-filepath: ./lychee/out.md
125+
# labels: report, automated issue
126+
105127
locmax:
106128
runs-on: ubuntu-latest
107129
if: github.event.repository.private == false
@@ -116,6 +138,7 @@ jobs:
116138
- uses: actions/checkout@v4
117139
- name: Check copyright headers
118140
run: |
141+
# Find Dart files without proper copyright headers, excluding generated files
119142
missing_copyright=$(find lib -type f -name '*.dart' \
120143
! -name '*.g.dart' \
121144
! -name '*.gr.dart' \
@@ -125,9 +148,50 @@ jobs:
125148
! -name '*.config.dart' \
126149
-exec grep -L "Copyright" {} \;)
127150
if [ -n "$missing_copyright" ]; then
128-
echo "Files missing copyright headers:"
151+
echo "Files missing copyright headers:"
129152
echo "$missing_copyright"
153+
echo ""
154+
echo "💡 Note: Generated files (*.g.dart, *.freezed.dart, etc.) are automatically excluded"
155+
exit 1
156+
else
157+
echo "✅ All non-generated Dart files have copyright headers"
158+
fi
159+
160+
# 20251017 gjw The usual command for running the integration tests
161+
# is `flutter test interaction_test` and each `*_test.dart` is
162+
# run. However for our testing of apps using solidui we need to
163+
# authenticate through an external browser login. The usual `flutter
164+
# test` will not properly authenticate. Instead, we should run `make
165+
# qtest.all` to run the tests. This action
166+
167+
test_enforcement:
168+
runs-on: ubuntu-latest
169+
if: github.event.repository.private == false
170+
steps:
171+
- uses: actions/checkout@v4
172+
- name: Check for batch test commands
173+
run: |
174+
# Check for disallowed "flutter test integration_test/" usage in scripts/workflows
175+
# Exclude comments and this CI check itself
176+
batch_test_found=$(grep -r "flutter test integration_test" \
177+
.github/workflows/ \
178+
support/ \
179+
scripts/ \
180+
Makefile 2>/dev/null | \
181+
grep -v "# Check for disallowed" | \
182+
grep -v "batch_test_found=" | \
183+
grep -v "echo.*flutter test integration_test/" || true)
184+
if [ -n "$batch_test_found" ]; then
185+
echo "❌ Found disallowed batch test command 'flutter test integration_test/'"
186+
echo ""
187+
echo "Found in:"
188+
echo "$batch_test_found"
189+
echo ""
190+
echo "⚠️ Batch testing fails on desktop due to Flutter framework limitations."
191+
echo "✅ Use 'make qtest' instead - it runs tests individually."
192+
echo ""
193+
echo "See docs/TESTING_GUIDE.md for details."
130194
exit 1
131195
else
132-
echo "All non-generated Dart files have copyright headers"
196+
echo "✅ No batch test commands found - using recommended 'make qtest' approach"
133197
fi

0 commit comments

Comments
 (0)