Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 31 additions & 10 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,9 @@ permissions:
jobs:
setup:
name: Setup
needs: []
timeout-minutes: 5
runs-on: ubuntu-latest

strategy:
fail-fast: false

steps:
- name: 📚 Git checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
Expand Down Expand Up @@ -81,7 +77,7 @@ jobs:
build:
name: Build
needs: ["setup"]
timeout-minutes: ${{ (matrix.target == 'web') && 5 || 10 }}
timeout-minutes: ${{ (matrix.target == 'web') && 5 || 20 }}
runs-on: ${{ matrix.os }}

strategy:
Expand Down Expand Up @@ -224,6 +220,9 @@ jobs:
timeout-minutes: 7
runs-on: ubuntu-latest

permissions:
id-token: write

steps:
- name: 📚 Git checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
Expand Down Expand Up @@ -268,9 +267,9 @@ jobs:
continue-on-error: true
- name: 📊 Upload code coverage
if: ${{ !cancelled() }}
uses: codecov/codecov-action@b9fd7d16f6d7d1b5d2bec1a2887e65ceed900238 # v4.6.0
uses: codecov/codecov-action@18283e04ce6e62d37312384ff67231eb8fd56d24 # v5.4.3
with:
token: ${{ secrets.CODECOV_TOKEN }}
use_oidc: true
files: packages/app/coverage/lcov.info
fail_ci_if_error: true
verbose: true
Expand Down Expand Up @@ -299,6 +298,8 @@ jobs:
cache: true
- name: 🌐 Disable analytics
run: flutter --disable-analytics
- name: 📦 Install dependencies
run: dart pub get --enforce-lockfile
- name: ✨ Verify formatting
run: dart format . --output=none --set-exit-if-changed

Expand Down Expand Up @@ -344,7 +345,6 @@ jobs:

spell-check:
name: Check Spelling
needs: []
runs-on: ubuntu-latest

steps:
Expand All @@ -370,7 +370,6 @@ jobs:

link-check:
name: Check Links
needs: []
timeout-minutes: 2
runs-on: ubuntu-latest

Expand All @@ -384,7 +383,6 @@ jobs:

markdownlint:
name: Lint Markdown
needs: []
timeout-minutes: 4
runs-on: ubuntu-latest

Expand All @@ -405,3 +403,26 @@ jobs:
# Surprisingly, the default is to only lint the project root.
globs: |
**/*.md

zizmor:
name: Run zizmor
timeout-minutes: 1
runs-on: ubuntu-latest

permissions:
contents: read
security-events: write
actions: read

steps:
- name: 📚 Git Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
submodules: recursive
clean: true
persist-credentials: false
set-safe-directory: true
- name: 🌈 Run zizmor
uses: zizmorcore/zizmor-action@2520132f44b3ed84916048d32e5c7153fc739fe7 # v0.0.3
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
12 changes: 8 additions & 4 deletions packages/_analysis_options/lib/analysis_options.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ linter:
prefer_mixin: true
unnecessary_null_aware_operator_on_extension_on_nullable: true
unreachable_from_main: true
require_trailing_commas: true

# Rules with false-positives, not in VGA
discarded_futures: true
Expand All @@ -65,13 +66,16 @@ linter:
specify_nonobvious_property_types: true

# New/updated rules, not yet in VGA
use_truncating_division: true
avoid_futureor_void: true
unnecessary_underscores: true
strict_top_level_inference: true
use_null_aware_elements: true
unnecessary_ignore: true
use_truncating_division: true

# Newly (or soon-to-be) deprecated rules, still in VGA
unnecessary_await_in_return: false
require_trailing_commas: false

# Additional information about this file can be found at
# https://dart.dev/guides/language/analysis-options

formatter:
trailing_commas: preserve
4 changes: 2 additions & 2 deletions packages/_analysis_options/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ issue_tracker: https://github.com/PHS-TSA/nexus/issues
repository: https://github.com/PHS-TSA/nexus.git

environment:
sdk: ^3.7.0
sdk: ^3.8.0
resolution: workspace

dependencies:
very_good_analysis: ^7.0.0
very_good_analysis: ^8.0.0-rc.1
8 changes: 6 additions & 2 deletions packages/app/lib/src/app/app.dart
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@
/// {@macro harvest_hub.app}
///
/// Construct a new [App] widget.
const App({super.key});
const App({
super.key,
});

@override
ConsumerState<App> createState() => _AppState();
Expand Down Expand Up @@ -80,7 +82,9 @@

/// Eagerly initializes providers.
class _EagerInitialization extends ConsumerWidget {
const _EagerInitialization({required this.child});
const _EagerInitialization({

Check warning on line 85 in packages/app/lib/src/app/app.dart

View check run for this annotation

Codecov / codecov/patch

packages/app/lib/src/app/app.dart#L85

Added line #L85 was not covered by tests
required this.child,
});

final Widget child;

Expand Down
6 changes: 4 additions & 2 deletions packages/app/lib/src/app/bootstrap.dart
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,10 @@ typedef GetSharedPreferences =
});

/// The environment needed to bootstrap the app.
typedef BootstrapEnv =
({RunApp runApp, GetSharedPreferences getSharedPreferences});
typedef BootstrapEnv = ({
RunApp runApp,
GetSharedPreferences getSharedPreferences,
});

/// Turn any widget into a flow-blown app.
mixin Bootstrap implements Widget {
Expand Down
19 changes: 13 additions & 6 deletions packages/app/lib/src/app/create_post.dart
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,9 @@
/// {@macro harvest_hub.app.create_post}
///
/// Construct a new [CreatePost] widget.
const CreatePost({super.key});
const CreatePost({
super.key,
});

@override
Widget build(BuildContext context, WidgetRef ref) {
Expand Down Expand Up @@ -99,10 +101,12 @@
),
),
insetPadding: EdgeInsets.symmetric(
horizontal:
context.sizeClass == MaterialWindowSizeClass.compact ? 0.0 : 64.0,
vertical:
context.sizeClass == MaterialWindowSizeClass.compact ? 0.0 : 48.0,
horizontal: context.sizeClass == MaterialWindowSizeClass.compact

Check warning on line 104 in packages/app/lib/src/app/create_post.dart

View check run for this annotation

Codecov / codecov/patch

packages/app/lib/src/app/create_post.dart#L104

Added line #L104 was not covered by tests
? 0.0
: 64.0,
vertical: context.sizeClass == MaterialWindowSizeClass.compact

Check warning on line 107 in packages/app/lib/src/app/create_post.dart

View check run for this annotation

Codecov / codecov/patch

packages/app/lib/src/app/create_post.dart#L107

Added line #L107 was not covered by tests
? 0.0
: 48.0,
),
child: Padding(
padding: EdgeInsets.all(
Expand Down Expand Up @@ -216,7 +220,10 @@
///
/// Notably, it also allows the user to remove images from the list.
class _UploadedImagesView extends HookConsumerWidget {
const _UploadedImagesView({super.key});
const _UploadedImagesView({
super.key,
});

@override
Widget build(BuildContext context, WidgetRef ref) {
final uploadedImages = ref.watch(uploadedImagesServiceProvider);
Expand Down
23 changes: 12 additions & 11 deletions packages/app/lib/src/app/wrapper.dart
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,10 @@
/// {@macro harvest_hub.app.wrapper}
///
/// Construct a new [Wrapper] widget.
const Wrapper({required this.child, super.key});
const Wrapper({
required this.child,
super.key,
});

/// The child widget to display.
final Widget child;
Expand Down Expand Up @@ -80,11 +83,10 @@
],
), // TODO(MattsAttack): Implement rail here, similar to Google article.
floatingActionButton: FloatingActionButton(
onPressed:
() async => showDialog<void>(
context: context,
builder: (context) => const CreatePost(),
),
onPressed: () async => showDialog<void>(

Check warning on line 86 in packages/app/lib/src/app/wrapper.dart

View check run for this annotation

Codecov / codecov/patch

packages/app/lib/src/app/wrapper.dart#L86

Added line #L86 was not covered by tests
context: context,
builder: (context) => const CreatePost(),

Check warning on line 88 in packages/app/lib/src/app/wrapper.dart

View check run for this annotation

Codecov / codecov/patch

packages/app/lib/src/app/wrapper.dart#L88

Added line #L88 was not covered by tests
),
child: const Icon(Icons.create),
), // TODO(MattsAttack): Change to form on top of feed for desktop.
);
Expand Down Expand Up @@ -112,11 +114,10 @@
Widget build(BuildContext context) {
return Scaffold(
floatingActionButton: FloatingActionButton(
onPressed:
() async => showDialog<void>(
context: context,
builder: (context) => const CreatePost(),
),
onPressed: () async => showDialog<void>(

Check warning on line 117 in packages/app/lib/src/app/wrapper.dart

View check run for this annotation

Codecov / codecov/patch

packages/app/lib/src/app/wrapper.dart#L117

Added line #L117 was not covered by tests
context: context,
builder: (context) => const CreatePost(),

Check warning on line 119 in packages/app/lib/src/app/wrapper.dart

View check run for this annotation

Codecov / codecov/patch

packages/app/lib/src/app/wrapper.dart#L119

Added line #L119 was not covered by tests
),
child: const Icon(Icons.create),
),
body: child,
Expand Down
4 changes: 3 additions & 1 deletion packages/app/lib/src/app/wrapper_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@ class WrapperPage extends ConsumerWidget {
/// {@macro harvest_hub.app.wrapper_page}
///
/// Construct a new [WrapperPage] widget.
const WrapperPage({super.key});
const WrapperPage({
super.key,
});

@override
Widget build(BuildContext context, WidgetRef ref) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,10 @@
/// {@macro harvest_hub.features.auth.presentation.auth.login_page}
///
/// Construct a new [LogInPage] widget.
const LogInPage({super.key, AuthCallback? onResult}) : _onResult = onResult;
const LogInPage({

Check warning on line 25 in packages/app/lib/src/features/auth/presentation/auth/log_in_page.dart

View check run for this annotation

Codecov / codecov/patch

packages/app/lib/src/features/auth/presentation/auth/log_in_page.dart#L25

Added line #L25 was not covered by tests
super.key,
AuthCallback? onResult,
}) : _onResult = onResult;

final AuthCallback? _onResult;

Expand All @@ -39,10 +42,13 @@
}

class _DesktopLogInPage extends HookConsumerWidget {
const _DesktopLogInPage({super.key, AuthCallback? onResult})
: _onResult = onResult;
const _DesktopLogInPage({

Check warning on line 45 in packages/app/lib/src/features/auth/presentation/auth/log_in_page.dart

View check run for this annotation

Codecov / codecov/patch

packages/app/lib/src/features/auth/presentation/auth/log_in_page.dart#L45

Added line #L45 was not covered by tests
super.key,
AuthCallback? onResult,
}) : _onResult = onResult;

final AuthCallback? _onResult;

@override
Widget build(BuildContext context, WidgetRef ref) {
final formKey = useGlobalKey<FormState>();
Expand Down Expand Up @@ -178,10 +184,13 @@
}

class _MobileLogInPage extends HookConsumerWidget {
const _MobileLogInPage({super.key, AuthCallback? onResult})
: _onResult = onResult;
const _MobileLogInPage({

Check warning on line 187 in packages/app/lib/src/features/auth/presentation/auth/log_in_page.dart

View check run for this annotation

Codecov / codecov/patch

packages/app/lib/src/features/auth/presentation/auth/log_in_page.dart#L187

Added line #L187 was not covered by tests
super.key,
AuthCallback? onResult,
}) : _onResult = onResult;

final AuthCallback? _onResult;

@override
Widget build(BuildContext context, WidgetRef ref) {
final formKey = useGlobalKey<FormState>();
Expand Down Expand Up @@ -250,10 +259,9 @@
'Welcome to Harvest Hub!',
style: TextStyle(
fontSize: 24,
color:
Theme.of(
context,
).colorScheme.onPrimaryContainer,
color: Theme.of(

Check warning on line 262 in packages/app/lib/src/features/auth/presentation/auth/log_in_page.dart

View check run for this annotation

Codecov / codecov/patch

packages/app/lib/src/features/auth/presentation/auth/log_in_page.dart#L262

Added line #L262 was not covered by tests
context,
).colorScheme.onPrimaryContainer,

Check warning on line 264 in packages/app/lib/src/features/auth/presentation/auth/log_in_page.dart

View check run for this annotation

Codecov / codecov/patch

packages/app/lib/src/features/auth/presentation/auth/log_in_page.dart#L264

Added line #L264 was not covered by tests
),
textAlign: TextAlign.center,
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,10 @@
/// {@macro harvest_hub.features.auth.presentation.auth.sign_up_page}
///
/// Construct a new [SignUpPage] widget.
const SignUpPage({super.key, AuthCallback? onResult}) : _onResult = onResult;
const SignUpPage({

Check warning on line 27 in packages/app/lib/src/features/auth/presentation/auth/sign_up_page.dart

View check run for this annotation

Codecov / codecov/patch

packages/app/lib/src/features/auth/presentation/auth/sign_up_page.dart#L27

Added line #L27 was not covered by tests
super.key,
AuthCallback? onResult,
}) : _onResult = onResult;

final AuthCallback? _onResult;

Expand All @@ -41,10 +44,13 @@
}

class _DesktopSignUpPage extends HookConsumerWidget {
const _DesktopSignUpPage({super.key, AuthCallback? onResult})
: _onResult = onResult;
const _DesktopSignUpPage({

Check warning on line 47 in packages/app/lib/src/features/auth/presentation/auth/sign_up_page.dart

View check run for this annotation

Codecov / codecov/patch

packages/app/lib/src/features/auth/presentation/auth/sign_up_page.dart#L47

Added line #L47 was not covered by tests
super.key,
AuthCallback? onResult,
}) : _onResult = onResult;

final AuthCallback? _onResult;

@override
Widget build(BuildContext context, WidgetRef ref) {
final formKey = useGlobalKey<FormState>();
Expand Down Expand Up @@ -190,10 +196,13 @@
}

class _MobileSignUpPage extends HookConsumerWidget {
const _MobileSignUpPage({super.key, AuthCallback? onResult})
: _onResult = onResult;
const _MobileSignUpPage({

Check warning on line 199 in packages/app/lib/src/features/auth/presentation/auth/sign_up_page.dart

View check run for this annotation

Codecov / codecov/patch

packages/app/lib/src/features/auth/presentation/auth/sign_up_page.dart#L199

Added line #L199 was not covered by tests
super.key,
AuthCallback? onResult,
}) : _onResult = onResult;

final AuthCallback? _onResult;

@override
Widget build(BuildContext context, WidgetRef ref) {
final formKey = useGlobalKey<FormState>();
Expand Down Expand Up @@ -262,10 +271,9 @@
'Welcome to Harvest Hub!',
style: TextStyle(
fontSize: 24,
color:
Theme.of(
context,
).colorScheme.onPrimaryContainer,
color: Theme.of(

Check warning on line 274 in packages/app/lib/src/features/auth/presentation/auth/sign_up_page.dart

View check run for this annotation

Codecov / codecov/patch

packages/app/lib/src/features/auth/presentation/auth/sign_up_page.dart#L274

Added line #L274 was not covered by tests
context,
).colorScheme.onPrimaryContainer,

Check warning on line 276 in packages/app/lib/src/features/auth/presentation/auth/sign_up_page.dart

View check run for this annotation

Codecov / codecov/patch

packages/app/lib/src/features/auth/presentation/auth/sign_up_page.dart#L276

Added line #L276 was not covered by tests
),
textAlign: TextAlign.center,
),
Expand Down
Loading
Loading