Skip to content

Commit

Permalink
Merge pull request #855 from YumNumm/chore/lints
Browse files Browse the repository at this point in the history
[chore] Lintを強力なものに変更
  • Loading branch information
YumNumm authored Nov 29, 2024
2 parents 0b8bef8 + 569d598 commit a8a93ac
Show file tree
Hide file tree
Showing 287 changed files with 3,480 additions and 2,542 deletions.
5 changes: 4 additions & 1 deletion .github/workflows/check-pull-request.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,10 @@ jobs:
uses: ./.github/actions/setup-application-runtime

- name: re-generated code
run: melos run regenerate_code --no-select
run: melos run rebuild --no-select

- name: format
run: melos run format --no-select

- name: check difference
run: |
Expand Down
16 changes: 3 additions & 13 deletions app/analysis_options.yaml
Original file line number Diff line number Diff line change
@@ -1,15 +1,5 @@
# https://pub.dev/packages/pedantic_mono
include: package:pedantic_mono/analysis_options.yaml

include: package:eqmonitor_lints/analysis_options.yaml
analyzer:
language:
plugins:
- custom_lint
errors:
invalid_annotation_target: ignore
duplicate_ignore: ignore

linter:
rules:
always_use_package_imports: true
lines_longer_than_80_chars: false
document_ignores: ignore
lines_longer_than_80_chars: ignore
8 changes: 4 additions & 4 deletions app/lib/app.dart
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,11 @@ class App extends HookConsumerWidget {

if (lightDynamic != null && darkDynamic != null) {
// On Android S+ devices, use the provided dynamic color scheme.
// (Recommended) Harmonize the dynamic color scheme' built-in semantic
// colors.
// (Recommended) Harmonize the dynamic color scheme'
// built-in semantic colors.
lightColorScheme = lightDynamic.harmonized();
// (Optional) Customize the scheme as desired. For example, one might
// want to use a brand color to override the dynamic
// (Optional) Customize the scheme as desired. For example,
// one might want to use a brand color to override the dynamic
// [ColorScheme.secondary].
lightColorScheme = lightColorScheme.copyWith(secondary: brandBlue);
// (Optional) If applicable, harmonize custom colors.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ import 'package:eqmonitor/core/provider/secure_storage.dart';
import 'package:eqmonitor/feature/settings/features/notification_remote_settings/data/notification_remote_settings_saved_state.dart';
import 'package:riverpod_annotation/riverpod_annotation.dart';

part 'api_authentication_service.g.dart';
part 'api_authentication_notifier.g.dart';

@Riverpod(keepAlive: true)
class ApiAuthenticationService extends _$ApiAuthenticationService {
class ApiAuthenticationNotifier extends _$ApiAuthenticationNotifier {
@override
Future<String?> build() async {
final secureStorage = ref.watch(secureStorageProvider);
Expand Down
29 changes: 29 additions & 0 deletions app/lib/core/api/api_authentication_notifier.g.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 5 additions & 4 deletions app/lib/core/api/api_authentication_payload.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import 'package:eqmonitor/core/api/api_authentication_service.dart';
import 'package:eqmonitor/core/api/api_authentication_notifier.dart';
import 'package:eqmonitor/feature/settings/features/notification_remote_settings/data/notification_remote_settings_saved_state.dart';
import 'package:hooks_riverpod/hooks_riverpod.dart';
import 'package:riverpod_annotation/riverpod_annotation.dart';

part 'api_authentication_payload.g.dart';
Expand All @@ -9,10 +10,10 @@ Future<
({
String id,
String role,
})> apiAuthenticationPayload(ApiAuthenticationPayloadRef ref) async {
final state = await ref.watch(apiAuthenticationServiceProvider.future);
})> apiAuthenticationPayload(Ref ref) async {
final state = await ref.watch(apiAuthenticationNotifierProvider.future);
if (state == null) {
throw UnauthorizedException();
}
return ref.read(apiAuthenticationServiceProvider.notifier).extractPayload();
return ref.read(apiAuthenticationNotifierProvider.notifier).extractPayload();
}
6 changes: 4 additions & 2 deletions app/lib/core/api/api_authentication_payload.g.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

29 changes: 0 additions & 29 deletions app/lib/core/api/api_authentication_service.g.dart

This file was deleted.

3 changes: 2 additions & 1 deletion app/lib/core/api/eq_api.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import 'package:dio/dio.dart';
import 'package:eqapi_client/eqapi_client.dart';
import 'package:eqmonitor/core/provider/dio_provider.dart';
import 'package:eqmonitor/core/provider/log/talker.dart';
import 'package:hooks_riverpod/hooks_riverpod.dart';
import 'package:riverpod_annotation/riverpod_annotation.dart';
import 'package:talker_dio_logger/talker_dio_logger_interceptor.dart';
import 'package:talker_dio_logger/talker_dio_logger_settings.dart';
Expand All @@ -10,7 +11,7 @@ import 'package:talker_flutter/talker_flutter.dart';
part 'eq_api.g.dart';

@Riverpod(keepAlive: true)
EqApi eqApi(EqApiRef ref) {
EqApi eqApi(Ref ref) {
final dio = ref.watch(dioProvider);
dio.options = dio.options.copyWith(
sendTimeout: const Duration(seconds: 10),
Expand Down
6 changes: 4 additions & 2 deletions app/lib/core/api/eq_api.g.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion app/lib/core/api/jma_parameter_api.dart
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import 'package:dio/dio.dart';
import 'package:hooks_riverpod/hooks_riverpod.dart';
import 'package:jma_parameter_api_client/jma_parameter_api_client.dart';
import 'package:riverpod_annotation/riverpod_annotation.dart';

part 'jma_parameter_api.g.dart';

@Riverpod(keepAlive: true)
JmaParameterApiClient jmaParameterApiClient(JmaParameterApiClientRef ref) {
JmaParameterApiClient jmaParameterApiClient(Ref ref) {
return JmaParameterApiClient(
client: Dio(
BaseOptions(
Expand Down
6 changes: 4 additions & 2 deletions app/lib/core/api/jma_parameter_api.g.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

24 changes: 10 additions & 14 deletions app/lib/core/component/button/action_button.dart
Original file line number Diff line number Diff line change
Expand Up @@ -48,21 +48,17 @@ class ActionButton extends StatelessWidget {
padding: const EdgeInsets.symmetric(
vertical: 4,
),
child: Row(
children: [
Flexible(
child: Center(
child: Text(
text,
style: Theme.of(context).textTheme.titleMedium!.copyWith(
fontWeight: FontWeight.bold,
color: Colors.white,
letterSpacing: 1.1,
),
),
),
child: Flexible(
child: Center(
child: Text(
text,
style: Theme.of(context).textTheme.titleMedium!.copyWith(
fontWeight: FontWeight.bold,
color: Colors.white,
letterSpacing: 1.1,
),
),
],
),
),
);

Expand Down
1 change: 1 addition & 0 deletions app/lib/core/component/chip/custom_chip.dart
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ class CustomChip extends StatelessWidget {
this.borderWidth = 0,
super.key,
});

final Widget child;
final Color? backgroundColor;
final double borderWidth;
Expand Down
3 changes: 2 additions & 1 deletion app/lib/core/component/chip/date_range_filter_chip.dart
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ extension MinMaxDateTime on (DateTime?, DateTime?) {
return '${DateRangeFilterChip.format.format(max!)} 以前';
}
// それ以外
return '${DateRangeFilterChip.format.format(min!)} ~ ${DateRangeFilterChip.format.format(max!)}';
return '${DateRangeFilterChip.format.format(min!)} ~ '
'${DateRangeFilterChip.format.format(max!)}';
}
}
1 change: 1 addition & 0 deletions app/lib/core/component/chip/depth_filter_chip.dart
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ class _DepthFilterModal extends HookWidget {
this.currentMin = initialMin,
this.currentMax = initialMax,
});

final int? currentMin;
final int? currentMax;

Expand Down
1 change: 1 addition & 0 deletions app/lib/core/component/chip/intensity_filter_chip.dart
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ class _IntensityFilterModal extends HookWidget {
this.currentMin = initialMin,
this.currentMax = initialMax,
});

final JmaIntensity? currentMin;
final JmaIntensity? currentMax;

Expand Down
1 change: 1 addition & 0 deletions app/lib/core/component/chip/magnitude_filter_chip.dart
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ class _MagnitudeFilterModal extends HookWidget {
this.currentMin = MagnitudeFilterChip.initialMin,
this.currentMax = MagnitudeFilterChip.initialMax,
});

final double? currentMin;
final double? currentMax;

Expand Down
1 change: 1 addition & 0 deletions app/lib/core/component/container/bordered_container.dart
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ class BorderedContainer extends StatelessWidget {
this.onPressed,
super.key,
});

final Widget child;
final Color? accentColor;
final EdgeInsetsGeometry padding;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ class JmaForecastIntensityWidget extends ConsumerWidget {
super.key,
this.size = 50,
});

final JmaForecastIntensity intensity;
final IntensityIconType type;
final double size;
Expand Down Expand Up @@ -114,6 +115,7 @@ class JmaForecastIntensityIcon extends ConsumerWidget {
this.size = 50,
this.showSuffix = true,
});

final JmaForecastIntensity intensity;
final IntensityIconType type;
final double size;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ class JmaForecastLgIntensityWidget extends ConsumerWidget {
super.key,
this.size = 50,
});

final JmaForecastLgIntensity intensity;
final IntensityIconType type;
final double size;
Expand Down
1 change: 1 addition & 0 deletions app/lib/core/component/intenisty/jma_intensity_icon.dart
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ class JmaIntensityIcon extends ConsumerWidget {
this.size = 50,
this.showSuffix = true,
});

final JmaIntensity intensity;
final IntensityIconType type;
final double size;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ class JmaLgIntensityIcon extends ConsumerWidget {
super.key,
this.size = 50,
});

final JmaLgIntensity intensity;
final IntensityIconType type;
final double size;
Expand Down
3 changes: 2 additions & 1 deletion app/lib/core/component/sheet/basic_modal_sheet.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,12 @@ import 'package:sheet/sheet.dart';

class BasicModalSheet extends HookWidget {
const BasicModalSheet({
super.key,
required this.controller,
required this.children,
super.key,
this.hasAppBar = true,
});

final SheetController controller;
final List<Widget> children;
final bool hasAppBar;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ import 'package:sheet/sheet.dart';

class SheetFloatingActionButtons extends HookWidget {
const SheetFloatingActionButtons({
super.key,
required this.controller,
required this.fab,
super.key,
this.maxHeight = 0.3,
this.hasAppBar = true,
});
Expand All @@ -21,6 +21,7 @@ class SheetFloatingActionButtons extends HookWidget {
final List<Widget> fab;

final SheetController controller;

@override
Widget build(BuildContext context) {
final size = MediaQuery.sizeOf(context);
Expand All @@ -32,7 +33,7 @@ class SheetFloatingActionButtons extends HookWidget {
(hasAppBar ? AppBar().preferredSize.height : 0));
return AnimatedBuilder(
animation: controller.animation,
builder: (BuildContext context, Widget? child) {
builder: (context, child) {
final bottom = height * controller.animation.value;
return Positioned(
right: padding.right,
Expand Down
Loading

0 comments on commit a8a93ac

Please sign in to comment.