-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
78 changed files
with
1,924 additions
and
152 deletions.
There are no files selected for viewing
Validating CODEOWNERS rules …
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
packages/netglade_analysis @tenhobi | ||
packages/netglade_utils @petrnymsa | ||
packages/netglade_flutter_utils @petrnymsa |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# To get started with Dependabot version updates, you'll need to specify which | ||
# package ecosystems to update and where the package manifests are located. | ||
# Please see the documentation for all configuration options: | ||
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates | ||
|
||
version: 2 | ||
updates: | ||
- package-ecosystem: "github-actions" | ||
directory: "/" | ||
schedule: | ||
interval: "weekly" | ||
|
||
# PACKAGES | ||
|
||
- package-ecosystem: "pub" | ||
directory: "/packages/netglade_analysis" | ||
schedule: | ||
interval: "weekly" | ||
|
||
- package-ecosystem: "pub" | ||
directory: "/packages/netglade_utils" | ||
schedule: | ||
interval: "weekly" | ||
|
||
- package-ecosystem: "pub" | ||
directory: "/packages/netglade_flutter_utils" | ||
schedule: | ||
interval: "weekly" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
name: netglade_flutter_utils test | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
tags-ignore: | ||
- 'netglade_flutter_utils-v*' | ||
paths: | ||
- 'packages/netglade_flutter_utils/**' | ||
pull_request: | ||
branches: | ||
- main | ||
paths: | ||
- 'packages/netglade_flutter_utils/**' | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: false | ||
defaults: | ||
run: | ||
working-directory: packages/netglade_flutter_utils | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: subosito/[email protected] | ||
|
||
- name: Install Dependencies | ||
run: flutter pub get | ||
|
||
- name: Format | ||
run: dart format --line-length 120 --set-exit-if-changed . | ||
|
||
- name: Analyze | ||
run: dart analyze . | ||
|
||
- name: Install DCM | ||
uses: CQLabs/setup-dcm@v1 | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Run DCM | ||
uses: CQLabs/dcm-action@v1 | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
ci_key: ${{ secrets.DCM_KEY }} | ||
email: ${{ secrets.DCM_EMAIL }} | ||
folders: . | ||
fatal_style: true | ||
fatal_performance: true | ||
fatal_warnings: true | ||
|
||
- name: Dry Publish | ||
run: flutter pub publish --dry-run || true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
name: netglade_utils test | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
tags-ignore: | ||
- 'netglade_utils-v*' | ||
paths: | ||
- 'packages/netglade_utils/**' | ||
pull_request: | ||
branches: | ||
- main | ||
paths: | ||
- 'packages/netglade_utils/**' | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: false | ||
defaults: | ||
run: | ||
working-directory: packages/netglade_utils | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: dart-lang/setup-dart@v1 | ||
|
||
- name: Install Dependencies | ||
run: dart pub get | ||
|
||
- name: Format | ||
run: dart format --line-length 120 --set-exit-if-changed . | ||
|
||
- name: Flutter Analyze | ||
run: flutter analyze --no-pub --fatal-infos --fatal-warnings | ||
|
||
- name: Install DCM | ||
uses: CQLabs/setup-dcm@v1 | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Run DCM | ||
uses: CQLabs/dcm-action@v1 | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
ci_key: ${{ secrets.DCM_KEY }} | ||
email: ${{ secrets.DCM_EMAIL }} | ||
folders: . | ||
fatal_style: true | ||
fatal_performance: true | ||
fatal_warnings: true | ||
|
||
- name: Dry Publish | ||
run: flutter pub publish --dry-run || true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,50 +1,31 @@ | ||
# Created by https://www.toptal.com/developers/gitignore/api/dart | ||
# Edit at https://www.toptal.com/developers/gitignore?templates=dart | ||
|
||
### Dart ### | ||
# See https://www.dartlang.org/guides/libraries/private-files | ||
|
||
# Files and directories created by pub | ||
.dart_tool/ | ||
.packages | ||
build/ | ||
# If you're building an application, you may want to check-in your pubspec.lock | ||
pubspec.lock | ||
|
||
# Directory created by dartdoc | ||
# If you don't generate documentation locally you can remove this line. | ||
doc/api/ | ||
|
||
# dotenv environment variables file | ||
.env* | ||
|
||
# Avoid committing generated Javascript files: | ||
*.dart.js | ||
*.info.json # Produced by the --dump-info flag. | ||
*.js # When generated by dart2js. Don't specify *.js if your | ||
# project includes source files written in JavaScript. | ||
*.js_ | ||
*.js.deps | ||
*.js.map | ||
|
||
.flutter-plugins | ||
.flutter-plugins-dependencies | ||
|
||
### Dart Patch ### | ||
# dotenv environment variables file | ||
.env | ||
|
||
# End of https://www.toptal.com/developers/gitignore/api/dart | ||
|
||
### CUSTOM RULES ### | ||
|
||
# IDEs | ||
.idea/ | ||
.vscode/ | ||
!.vscode/launch.json | ||
!.vscode/settings.json | ||
|
||
# Generated files | ||
**/*.g.dart | ||
**/*.freezed.dart | ||
lib/generated/ | ||
.DS_Store | ||
.atom/ | ||
.idea/ | ||
!.idea/runConfigurations | ||
.melos_tool/* | ||
melos_my_project.iml | ||
.vscode/* | ||
!.vscode/tasks.json | ||
!.vscode/settings.json | ||
|
||
.packages | ||
.pub/ | ||
.dart_tool/ | ||
pubspec.lock | ||
pubspec_overrides.yaml | ||
|
||
GeneratedPluginRegistrant.h | ||
GeneratedPluginRegistrant.m | ||
GeneratedPluginRegistrant.java | ||
GeneratedPluginRegistrant.swift | ||
generated_plugin_registrant.dart | ||
|
||
build/ | ||
.flutter-plugins | ||
.flutter-plugins-dependencies | ||
|
||
.project | ||
.classpath | ||
.settings | ||
.last_build_id | ||
*.iml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,85 +1,38 @@ | ||
<a href="https://github.com/netglade"> | ||
<picture > | ||
<source media="(prefers-color-scheme: dark)" height='120px' srcset="https://raw.githubusercontent.com/netglade/netglade_analysis/main/doc/badge_light.png"> | ||
<source media="(prefers-color-scheme: light)" height='120px' srcset="https://raw.githubusercontent.com/netglade/netglade_analysis/main/doc/badge_dark.png"> | ||
<img alt="netglade" height='120px' src="https://raw.githubusercontent.com/netglade/netglade_analysis/main/doc/badge_dark.png"> | ||
</picture> | ||
</a> | ||
|
||
Developed with 💚 by [netglade][netglade_link] | ||
|
||
[![ci][ci_badge]][ci_badge_link] | ||
[![pub package][pub_badge]][pub_badge_link] | ||
[![license: MIT][license_badge]][license_badge_link] | ||
[![style: netglade analysis][style_badge]][style_badge_link] | ||
[![Discord][discord_badge]][discord_badge_link] | ||
|
||
--- | ||
|
||
This package provides lint rules for Dart and Flutter which are used at [netglade][netglade_link]. | ||
|
||
You can also check all the available Dart lint rules on [linter rules site][linter_rules] or [supported lint rules site][supported_lint_rules]. | ||
And you can see all the available on [DCM rules site][dcm_rules]. | ||
|
||
## Usage | ||
|
||
To use the lints, add as a dev dependency in your `pubspec.yaml`: | ||
|
||
```yaml | ||
dev_dependencies: | ||
netglade_analysis: ^4.0.0 | ||
``` | ||
Then, add an include in `analysis_options.yaml`: | ||
|
||
```yaml | ||
include: package:netglade_analysis/lints.yaml | ||
``` | ||
|
||
To also use [Dart Code Metrics](https://dcm.dev), add configuration in `analysis_options.yaml`. | ||
Then you can use its CLI tool. | ||
|
||
```yaml | ||
dart_code_metrics: | ||
extends: | ||
- package:netglade_analysis/dcm.yaml | ||
``` | ||
|
||
## Recommendations | ||
|
||
Consider adding an analyzer exclude for generated, coverage, ... files. | ||
|
||
```yaml | ||
analyzer: | ||
exclude: | ||
- '**/*.g.dart' | ||
- '**/*.freezed.dart' | ||
- test/.test_coverage.dart | ||
- lib/generated_plugin_registrant.dart | ||
``` | ||
|
||
## Badge | ||
|
||
To indicate your project is using `netglade_analysis` → | ||
[![style: netglade analysis][style_badge]][style_badge_link] | ||
|
||
```md | ||
[![style: netglade analysis](https://img.shields.io/badge/style-netglade_analysis-26D07C.svg)](https://pub.dev/packages/netglade_analysis) | ||
``` | ||
|
||
[netglade_link]: https://netglade.com/en | ||
|
||
[ci_badge]: https://github.com/netglade/netglade_analysis/workflows/ci/badge.svg | ||
[ci_badge_link]: https://github.com/netglade/netglade_analysis/actions | ||
[license_badge]: https://img.shields.io/badge/license-MIT-blue.svg | ||
[license_badge_link]: https://opensource.org/licenses/MIT | ||
[pub_badge]: https://img.shields.io/pub/v/netglade_analysis.svg | ||
[pub_badge_link]: https://pub.dartlang.org/packages/netglade_analysis | ||
[style_badge]: https://img.shields.io/badge/style-netglade_analysis-26D07C.svg | ||
[style_badge_link]: https://pub.dev/packages/netglade_analysis | ||
[discord_badge]: https://img.shields.io/discord/1091460081054400532.svg?logo=discord&color=blue | ||
[discord_badge_link]: https://discord.gg/sJfBBuDZy4 | ||
|
||
[linter_rules]: https://dart.dev/tools/linter-rules | ||
[supported_lint_rules]: https://dart-lang.github.io/linter/lints | ||
[dcm_rules]: https://dcm.dev/docs/rules/ | ||
# NetGlade Flutter Core | ||
|
||
[![license: MIT][license_badge]][license_badge_link] | ||
[![Discord][discord_badge]][discord_badge_link] | ||
|
||
Dart and Flutter packages used internally at [netglade][netglade_link] | ||
|
||
| Package | pub | CI | | ||
| ----------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------ | ---------------------------------------------------------------------------------- | | ||
| [netglade_analysis][netglade_analysis-link] | [![netglade_analysis pub.dev badge][netglade_analysis-pub-badge]][netglade_analysis-pub-badge-link] | [![][netglade_analysis-build-badge]][netglade_analysis-build-badge-link] | | ||
| [netglade_utils][netglade_utils-link] | [![netglade_utils pub.dev badge][netglade_utils-pub-badge]][netglade_utils-pub-badge-link] | [![][netglade_utils-build-badge]][netglade_utils-build-badge-link] | | ||
| [netglade_flutter_utils][netglade_flutter_utils-link] | [![netglade_flutter_utils pub.dev badge][netglade_flutter_utils-pub-badge]][netglade_flutter_utils-pub-badge-link] | [![][netglade_flutter_utils-build-badge]][netglade_flutter_utils-build-badge-link] | | ||
|
||
|
||
|
||
[netglade_link]: https://netglade.com/en | ||
[discord_badge]: https://img.shields.io/discord/1091460081054400532.svg?logo=discord&color=blue | ||
[discord_badge_link]: https://discord.gg/sJfBBuDZy4 | ||
[license_badge]: https://img.shields.io/badge/license-MIT-blue.svg | ||
[license_badge_link]: https://opensource.org/licenses/MIT | ||
|
||
[netglade_analysis-link]: https://github.com/netglade/flutter_core/tree/main/packages/netglade_analysis | ||
[netglade_analysis-pub-badge]: https://img.shields.io/pub/v/netglade_analysis.svg | ||
[netglade_analysis-pub-badge-link]: https://pub.dartlang.org/packages/netglade_analysis | ||
[netglade_analysis-build-badge]: https://github.com/netglade/flutter_core/workflows/netglade_analysis-test/badge.svg | ||
[netglade_analysis-build-badge-link]: https://github.com/netglade/flutter_core/actions/workflows/netglade_utils-test.yaml | ||
|
||
[netglade_utils-link]: https://github.com/netglade/flutter_core/tree/main/packages/netglade_utils | ||
[netglade_utils-pub-badge]: https://img.shields.io/pub/v/netglade_utils.svg | ||
[netglade_utils-pub-badge-link]: https://pub.dartlang.org/packages/netglade_utils | ||
[netglade_utils-build-badge]: https://github.com/netglade/flutter_core/workflows/netglade_utils-test/badge.svg | ||
[netglade_utils-build-badge-link]: https://github.com/netglade/flutter_core/actions/workflows/netglade_utils-test.yaml | ||
|
||
[netglade_flutter_utils-link]: https://github.com/netglade/flutter_core/tree/main/packages/netglade_flutter_utils | ||
[netglade_flutter_utils-pub-badge]: https://img.shields.io/pub/v/netglade_flutter_utils.svg | ||
[netglade_flutter_utils-pub-badge-link]: https://pub.dartlang.org/packages/netglade_flutter_utils | ||
[netglade_flutter_utils-build-badge]: https://github.com/netglade/flutter_core/workflows/netglade_flutter_utils-test/badge.svg | ||
[netglade_flutter_utils-build-badge-link]: https://github.com/netglade/flutter_core/actions/workflows/netglade_utils-test.yaml |
Binary file not shown.
Oops, something went wrong.