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
2 changes: 1 addition & 1 deletion .github/workflows/flutter-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
steps:
- uses: actions/checkout@v4

- uses: subosito/flutter-action@v2.18.0
- uses: subosito/flutter-action@v2.21.0
with:
channel: "stable"
cache: true
Expand Down
22 changes: 18 additions & 4 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,29 @@ name: Publish to pub.dev
on:
push:
tags:
- 'v[0-9]+.[0-9]+.[0-9]+' # Matches v1.2.3
- 'v[0-9]+.[0-9]+.[0-9]+\+[0-9]+' # Matches v1.2.3+1
- "disco-[0-9]+.[0-9]+.[0-9]+" # Matches disco-1.2.3
- 'disco-[0-9]+.[0-9]+.[0-9]+\+[0-9]+' # Matches disco-1.2.3+1
- "disco_lint-[0-9]+.[0-9]+.[0-9]+" # Matches disco_lint-1.2.3
- 'disco_lint-[0-9]+.[0-9]+.[0-9]+\+[0-9]+' # Matches disco_lint-1.2.3+1

# Publish using the reusable workflow from dart-lang.
jobs:
publish:
publish-disco:
if: startsWith(github.ref, 'refs/tags/disco-')
permissions:
id-token: write # Required for authentication using OIDC
uses: dart-lang/setup-dart/.github/workflows/publish.yml@v1
uses: nank1ro/flutter-shadcn-ui/.github/workflows/cached-publish.yaml@main
with:
environment: pub.dev
working-directory: packages/disco
install_flutter: true

publish-disco-lint:
if: startsWith(github.ref, 'refs/tags/disco_lint-')
permissions:
id-token: write # Required for authentication using OIDC
uses: nank1ro/flutter-shadcn-ui/.github/workflows/cached-publish.yaml@main
with:
environment: pub.dev
working-directory: packages/disco_lint
install_flutter: false
5 changes: 5 additions & 0 deletions analysis_options.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,8 @@ linter:

# For additional information about configuring this file, see
# https://dart.dev/guides/language/analysis-options


plugins:
disco_lint:
path: packages/disco_lint
2 changes: 1 addition & 1 deletion docs/src/content/docs/examples/auto-route.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ This is the `auto_route` version used in this example:

```yaml {2}
dependencies:
auto_route: ^9.3.0+1
auto_route: ^11.0.0
```

## File structure
Expand Down
14 changes: 13 additions & 1 deletion docs/src/content/docs/installing.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Alternatively, you can add Disco manually by updating your `pubspec.yaml` file a
name: # your app name

environment:
sdk: ^3.6.0 # Dart SDK version must be >=3.6.0 to support disco
sdk: ^3.10.0 # Dart SDK version must be >=3.6.0 to support disco and >=3.10.0 to support disco_lint
flutter: ">=3.27.0"

dependencies:
Expand All @@ -31,3 +31,15 @@ dependencies:
```

After updating the file, run `flutter pub get` in your terminal to fetch the dependencies.

## Linter

Disco provides an analyzer package called `disco_lint` to help you avoid common mistakes and simplify repetitive tasks (e.g. `Wrap with ProviderScope`).
Be sure to have the Dart SDK version `>= 3.10.0` and the Flutter SDK `>= 3.38.0`.

Then edit your `analysis_options.yaml` file and add these lines of code:

```yaml
plugins:
disco_lint: ^1.0.0
```
10 changes: 5 additions & 5 deletions examples/auto_route/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,21 @@ publish_to: "none"
version: 0.0.1

environment:
sdk: ^3.6.0
sdk: ^3.10.0

resolution: workspace

dependencies:
auto_route: ^9.3.0+1
auto_route: ^11.0.0
disco:
path: ../../packages/disco
flutter:
sdk: flutter

dev_dependencies:
auto_route_generator: ^9.3.1
build_runner: ^2.4.14
very_good_analysis: ^9.0.0
auto_route_generator: ^10.4.0
build_runner: ^2.10.4
very_good_analysis: ^10.0.0

flutter:
uses-material-design: true
4 changes: 2 additions & 2 deletions examples/bloc/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ publish_to: 'none'
version: 0.0.1

environment:
sdk: ^3.6.0
sdk: ^3.10.0

resolution: workspace

Expand All @@ -18,7 +18,7 @@ dependencies:
dev_dependencies:
flutter_test:
sdk: flutter
very_good_analysis: ^9.0.0
very_good_analysis: ^10.0.0

flutter:
uses-material-design: true
4 changes: 2 additions & 2 deletions examples/preferences/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ publish_to: "none"
version: 1.0.0+1

environment:
sdk: ^3.6.0
sdk: ^3.10.0

resolution: workspace

Expand All @@ -20,7 +20,7 @@ dev_dependencies:
flutter_test:
sdk: flutter

flutter_lints: ^5.0.0
flutter_lints: ^6.0.0

flutter:
uses-material-design: true
2 changes: 0 additions & 2 deletions examples/solidart/analysis_options.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ include: package:very_good_analysis/analysis_options.yaml
analyzer:
errors:
always_put_required_named_parameters_first: ignore
plugins:
- custom_lint

linter:
rules:
Expand Down
6 changes: 2 additions & 4 deletions examples/solidart/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ publish_to: "none"
version: 0.0.1

environment:
sdk: ^3.6.0
sdk: ^3.10.0

resolution: workspace

Expand All @@ -17,11 +17,9 @@ dependencies:
uuid: ^4.5.1

dev_dependencies:
custom_lint: ^0.7.0
flutter_test:
sdk: flutter
solidart_lint: ^2.0.0
very_good_analysis: ^9.0.0
very_good_analysis: ^10.0.0

dependency_overrides:
dart_style: ^3.0.1
Expand Down
4 changes: 4 additions & 0 deletions packages/disco/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 2.0.0

- **FEAT**: Introduce the new `disco_lint` package to help avoid common mistakes and simplify repetitive tasks.

## 1.0.3+1

- **CHORE**: Improve documentation.
Expand Down
4 changes: 2 additions & 2 deletions packages/disco/example/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ publish_to: "none"
version: 0.0.1

environment:
sdk: ^3.6.0
sdk: ^3.10.0

resolution: workspace

Expand All @@ -17,7 +17,7 @@ dependencies:
dev_dependencies:
flutter_test:
sdk: flutter
very_good_analysis: ^9.0.0
very_good_analysis: ^10.0.0

flutter:
uses-material-design: true
4 changes: 2 additions & 2 deletions packages/disco/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ topics:
- provider

environment:
sdk: ^3.6.0
sdk: ^3.10.0

resolution: workspace

Expand All @@ -23,4 +23,4 @@ dev_dependencies:
flutter_test:
sdk: flutter
mockito: ^5.4.5
very_good_analysis: ^9.0.0
very_good_analysis: ^10.0.0
3 changes: 3 additions & 0 deletions packages/disco_lint/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# https://dart.dev/guides/libraries/private-files
# Created by `dart pub`
.dart_tool/
1 change: 1 addition & 0 deletions packages/disco_lint/.pubignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
assets/
3 changes: 3 additions & 0 deletions packages/disco_lint/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
## 1.0.0

- Initial version.
20 changes: 20 additions & 0 deletions packages/disco_lint/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
This package is a developer tool for users of disco, designed to help stop common issues and simplify repetitive tasks.

> I highly recommend using this package to avoid errors and understand how to properly use disco
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In a new PR, I would just reframe this to "> It is highly recommended to use this lint package in combination with Disco."

## Getting started

Be sure to have the Dart SDK version `>= 3.10.0` and the Flutter SDK `>= 3.38.0`.

Then edit your `analysis_options.yaml` file and add these lines of code:

```yaml
plugins:
disco_lint: ^1.0.0
```
## ASSISTS
### Wrap with ProviderScope
![Wrap with ProviderScope sample](https://raw.githubusercontent.com/our-creativity/disco/main/packages/disco_lint/assets/wrap-with-providerscope.gif)
30 changes: 30 additions & 0 deletions packages/disco_lint/analysis_options.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# This file configures the static analysis results for your project (errors,
# warnings, and lints).
#
# This enables the 'recommended' set of lints from `package:lints`.
# This set helps identify many issues that may lead to problems when running
# or consuming Dart code, and enforces writing Dart using a single, idiomatic
# style and format.
#
# If you want a smaller set of lints you can change this to specify
# 'package:lints/core.yaml'. These are just the most critical lints
# (the recommended set includes the core lints).
# The core lints are also what is used by pub.dev for scoring packages.

include: package:lints/recommended.yaml

# Uncomment the following section to specify additional rules.

# linter:
# rules:
# - camel_case_types

# analyzer:
# exclude:
# - path/to/excluded/files/**

# For more information about the core and recommended set of lints, see
# https://dart.dev/go/core-lints

# For additional information about configuring this file, see
# https://dart.dev/guides/language/analysis-options
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
45 changes: 45 additions & 0 deletions packages/disco_lint/example/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# Miscellaneous
*.class
*.log
*.pyc
*.swp
.DS_Store
.atom/
.build/
.buildlog/
.history
.svn/
.swiftpm/
migrate_working_dir/

# IntelliJ related
*.iml
*.ipr
*.iws
.idea/

# The .vscode folder contains launch configuration and tasks you configure in
# VS Code which you may wish to be included in version control, so this line
# is commented out by default.
#.vscode/

# Flutter/Dart/Pub related
**/doc/api/
**/ios/Flutter/.last_build_id
.dart_tool/
.flutter-plugins-dependencies
.pub-cache/
.pub/
/build/
/coverage/

# Symbolication related
app.*.symbols

# Obfuscation related
app.*.map.json

# Android Studio will place build artifacts here
/android/app/debug
/android/app/profile
/android/app/release
30 changes: 30 additions & 0 deletions packages/disco_lint/example/.metadata
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# This file tracks properties of this Flutter project.
# Used by Flutter tool to assess capabilities and perform upgrades etc.
#
# This file should be version controlled and should not be manually edited.

version:
revision: "66dd93f9a27ffe2a9bfc8297506ce066ff51265f"
channel: "stable"

project_type: app

# Tracks metadata for the flutter migrate command
migration:
platforms:
- platform: root
create_revision: 66dd93f9a27ffe2a9bfc8297506ce066ff51265f
base_revision: 66dd93f9a27ffe2a9bfc8297506ce066ff51265f
- platform: macos
create_revision: 66dd93f9a27ffe2a9bfc8297506ce066ff51265f
base_revision: 66dd93f9a27ffe2a9bfc8297506ce066ff51265f

# User provided section

# List of Local paths (relative to this file) that should be
# ignored by the migrate tool.
#
# Files that are not part of the templates will be ignored by default.
unmanaged_files:
- 'lib/main.dart'
- 'ios/Runner.xcodeproj/project.pbxproj'
16 changes: 16 additions & 0 deletions packages/disco_lint/example/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# lint_example

A new Flutter project.

## Getting Started

This project is a starting point for a Flutter application.

A few resources to get you started if this is your first Flutter project:

- [Lab: Write your first Flutter app](https://docs.flutter.dev/get-started/codelab)
- [Cookbook: Useful Flutter samples](https://docs.flutter.dev/cookbook)

For help getting started with Flutter development, view the
[online documentation](https://docs.flutter.dev/), which offers tutorials,
samples, guidance on mobile development, and a full API reference.
Loading