Skip to content

Commit

Permalink
Merge remote-tracking branch 'google/master' into google#780
Browse files Browse the repository at this point in the history
  • Loading branch information
hacker1024 committed Feb 6, 2021
2 parents e8bd3dc + c7a7250 commit 8c1a3bd
Show file tree
Hide file tree
Showing 10 changed files with 382 additions and 322 deletions.
96 changes: 55 additions & 41 deletions .github/workflows/dart.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Created with package:mono_repo v3.4.2
# Created with package:mono_repo v3.4.5
name: Dart CI
on:
push:
Expand Down Expand Up @@ -27,13 +27,13 @@ jobs:
restore-keys: |
os:ubuntu-latest;pub-cache-hosted
os:ubuntu-latest
- uses: cedx/setup-dart@v2
- uses: dart-lang/setup-dart@v0.3
with:
release-channel: stable
- run: dart --version
- uses: actions/checkout@v2
sdk: stable
- id: checkout
uses: actions/checkout@v2
- name: mono_repo self validate
run: pub global activate mono_repo 3.4.2
run: pub global activate mono_repo 3.4.5
- name: mono_repo self validate
run: pub global run mono_repo generate --validate
job_002:
Expand All @@ -50,69 +50,74 @@ jobs:
os:ubuntu-latest;pub-cache-hosted;dart:dev
os:ubuntu-latest;pub-cache-hosted
os:ubuntu-latest
- uses: cedx/setup-dart@v2
- uses: dart-lang/setup-dart@v0.3
with:
release-channel: dev
- run: dart --version
- uses: actions/checkout@v2
sdk: dev
- id: checkout
uses: actions/checkout@v2
- id: _test_yaml_pub_upgrade
name: "_test_yaml; pub upgrade --no-precompile"
if: "always() && steps.checkout.conclusion == 'success'"
working-directory: _test_yaml
run: pub upgrade --no-precompile
- name: "_test_yaml; dartfmt -n --set-exit-if-changed ."
if: "steps._test_yaml_pub_upgrade.conclusion == 'success'"
if: "always() && steps._test_yaml_pub_upgrade.conclusion == 'success'"
working-directory: _test_yaml
run: dartfmt -n --set-exit-if-changed .
- name: "_test_yaml; dartanalyzer --fatal-infos ."
if: "steps._test_yaml_pub_upgrade.conclusion == 'success'"
if: "always() && steps._test_yaml_pub_upgrade.conclusion == 'success'"
working-directory: _test_yaml
run: dartanalyzer --fatal-infos .
- id: checked_yaml_pub_upgrade
name: "checked_yaml; pub upgrade --no-precompile"
if: "always() && steps.checkout.conclusion == 'success'"
working-directory: checked_yaml
run: pub upgrade --no-precompile
- name: "checked_yaml; dartfmt -n --set-exit-if-changed ."
if: "steps.checked_yaml_pub_upgrade.conclusion == 'success'"
if: "always() && steps.checked_yaml_pub_upgrade.conclusion == 'success'"
working-directory: checked_yaml
run: dartfmt -n --set-exit-if-changed .
- name: "checked_yaml; dartanalyzer --fatal-infos ."
if: "steps.checked_yaml_pub_upgrade.conclusion == 'success'"
if: "always() && steps.checked_yaml_pub_upgrade.conclusion == 'success'"
working-directory: checked_yaml
run: dartanalyzer --fatal-infos .
- id: example_pub_upgrade
name: "example; pub upgrade --no-precompile"
if: "always() && steps.checkout.conclusion == 'success'"
working-directory: example
run: pub upgrade --no-precompile
- name: "example; dartfmt -n --set-exit-if-changed ."
if: "steps.example_pub_upgrade.conclusion == 'success'"
if: "always() && steps.example_pub_upgrade.conclusion == 'success'"
working-directory: example
run: dartfmt -n --set-exit-if-changed .
- name: "example; dartanalyzer --fatal-infos ."
if: "steps.example_pub_upgrade.conclusion == 'success'"
if: "always() && steps.example_pub_upgrade.conclusion == 'success'"
working-directory: example
run: dartanalyzer --fatal-infos .
- id: json_annotation_pub_upgrade
name: "json_annotation; pub upgrade --no-precompile"
if: "always() && steps.checkout.conclusion == 'success'"
working-directory: json_annotation
run: pub upgrade --no-precompile
- name: "json_annotation; dartfmt -n --set-exit-if-changed ."
if: "steps.json_annotation_pub_upgrade.conclusion == 'success'"
if: "always() && steps.json_annotation_pub_upgrade.conclusion == 'success'"
working-directory: json_annotation
run: dartfmt -n --set-exit-if-changed .
- name: "json_annotation; dartanalyzer --fatal-infos ."
if: "steps.json_annotation_pub_upgrade.conclusion == 'success'"
if: "always() && steps.json_annotation_pub_upgrade.conclusion == 'success'"
working-directory: json_annotation
run: dartanalyzer --fatal-infos .
- id: json_serializable_pub_upgrade
name: "json_serializable; pub upgrade --no-precompile"
if: "always() && steps.checkout.conclusion == 'success'"
working-directory: json_serializable
run: pub upgrade --no-precompile
- name: "json_serializable; dartfmt -n --set-exit-if-changed ."
if: "steps.json_serializable_pub_upgrade.conclusion == 'success'"
if: "always() && steps.json_serializable_pub_upgrade.conclusion == 'success'"
working-directory: json_serializable
run: dartfmt -n --set-exit-if-changed .
- name: "json_serializable; dartanalyzer --fatal-infos ."
if: "steps.json_serializable_pub_upgrade.conclusion == 'success'"
if: "always() && steps.json_serializable_pub_upgrade.conclusion == 'success'"
working-directory: json_serializable
run: dartanalyzer --fatal-infos .
job_003:
Expand All @@ -129,41 +134,45 @@ jobs:
os:ubuntu-latest;pub-cache-hosted;dart:dev
os:ubuntu-latest;pub-cache-hosted
os:ubuntu-latest
- uses: cedx/setup-dart@v2
- uses: dart-lang/setup-dart@v0.3
with:
release-channel: dev
- run: dart --version
- uses: actions/checkout@v2
sdk: dev
- id: checkout
uses: actions/checkout@v2
- id: _test_yaml_pub_upgrade
name: "_test_yaml; pub upgrade --no-precompile"
if: "always() && steps.checkout.conclusion == 'success'"
working-directory: _test_yaml
run: pub upgrade --no-precompile
- name: _test_yaml; pub run test
if: "steps._test_yaml_pub_upgrade.conclusion == 'success'"
if: "always() && steps._test_yaml_pub_upgrade.conclusion == 'success'"
working-directory: _test_yaml
run: pub run test
- id: checked_yaml_pub_upgrade
name: "checked_yaml; pub upgrade --no-precompile"
if: "always() && steps.checkout.conclusion == 'success'"
working-directory: checked_yaml
run: pub upgrade --no-precompile
- name: checked_yaml; pub run test
if: "steps.checked_yaml_pub_upgrade.conclusion == 'success'"
if: "always() && steps.checked_yaml_pub_upgrade.conclusion == 'success'"
working-directory: checked_yaml
run: pub run test
- id: example_pub_upgrade
name: "example; pub upgrade --no-precompile"
if: "always() && steps.checkout.conclusion == 'success'"
working-directory: example
run: pub upgrade --no-precompile
- name: example; pub run test
if: "steps.example_pub_upgrade.conclusion == 'success'"
if: "always() && steps.example_pub_upgrade.conclusion == 'success'"
working-directory: example
run: pub run test
- id: json_serializable_pub_upgrade
name: "json_serializable; pub upgrade --no-precompile"
if: "always() && steps.checkout.conclusion == 'success'"
working-directory: json_serializable
run: pub upgrade --no-precompile
- name: json_serializable; pub run test
if: "steps.json_serializable_pub_upgrade.conclusion == 'success'"
if: "always() && steps.json_serializable_pub_upgrade.conclusion == 'success'"
working-directory: json_serializable
run: pub run test
needs:
Expand All @@ -183,17 +192,18 @@ jobs:
os:ubuntu-latest;pub-cache-hosted;dart:dev
os:ubuntu-latest;pub-cache-hosted
os:ubuntu-latest
- uses: cedx/setup-dart@v2
- uses: dart-lang/setup-dart@v0.3
with:
release-channel: dev
- run: dart --version
- uses: actions/checkout@v2
sdk: dev
- id: checkout
uses: actions/checkout@v2
- id: json_serializable_pub_upgrade
name: "json_serializable; pub upgrade --no-precompile"
if: "always() && steps.checkout.conclusion == 'success'"
working-directory: json_serializable
run: pub upgrade --no-precompile
- name: "json_serializable; pub run test -p chrome"
if: "steps.json_serializable_pub_upgrade.conclusion == 'success'"
if: "always() && steps.json_serializable_pub_upgrade.conclusion == 'success'"
working-directory: json_serializable
run: pub run test -p chrome
needs:
Expand All @@ -213,41 +223,45 @@ jobs:
os:ubuntu-latest;pub-cache-hosted;dart:dev
os:ubuntu-latest;pub-cache-hosted
os:ubuntu-latest
- uses: cedx/setup-dart@v2
- uses: dart-lang/setup-dart@v0.3
with:
release-channel: dev
- run: dart --version
- uses: actions/checkout@v2
sdk: dev
- id: checkout
uses: actions/checkout@v2
- id: _test_yaml_pub_upgrade
name: "_test_yaml; pub upgrade --no-precompile"
if: "always() && steps.checkout.conclusion == 'success'"
working-directory: _test_yaml
run: pub upgrade --no-precompile
- name: "_test_yaml; pub run test --run-skipped -t presubmit-only test/ensure_build_test.dart"
if: "steps._test_yaml_pub_upgrade.conclusion == 'success'"
if: "always() && steps._test_yaml_pub_upgrade.conclusion == 'success'"
working-directory: _test_yaml
run: pub run test --run-skipped -t presubmit-only test/ensure_build_test.dart
- id: checked_yaml_pub_upgrade
name: "checked_yaml; pub upgrade --no-precompile"
if: "always() && steps.checkout.conclusion == 'success'"
working-directory: checked_yaml
run: pub upgrade --no-precompile
- name: "checked_yaml; pub run test --run-skipped -t presubmit-only test/ensure_build_test.dart"
if: "steps.checked_yaml_pub_upgrade.conclusion == 'success'"
if: "always() && steps.checked_yaml_pub_upgrade.conclusion == 'success'"
working-directory: checked_yaml
run: pub run test --run-skipped -t presubmit-only test/ensure_build_test.dart
- id: example_pub_upgrade
name: "example; pub upgrade --no-precompile"
if: "always() && steps.checkout.conclusion == 'success'"
working-directory: example
run: pub upgrade --no-precompile
- name: "example; pub run test --run-skipped -t presubmit-only test/ensure_build_test.dart"
if: "steps.example_pub_upgrade.conclusion == 'success'"
if: "always() && steps.example_pub_upgrade.conclusion == 'success'"
working-directory: example
run: pub run test --run-skipped -t presubmit-only test/ensure_build_test.dart
- id: json_serializable_pub_upgrade
name: "json_serializable; pub upgrade --no-precompile"
if: "always() && steps.checkout.conclusion == 'success'"
working-directory: json_serializable
run: pub upgrade --no-precompile
- name: "json_serializable; pub run test --run-skipped -t presubmit-only test/ensure_build_test.dart"
if: "steps.json_serializable_pub_upgrade.conclusion == 'success'"
if: "always() && steps.json_serializable_pub_upgrade.conclusion == 'success'"
working-directory: json_serializable
run: pub run test --run-skipped -t presubmit-only test/ensure_build_test.dart
needs:
Expand Down
30 changes: 30 additions & 0 deletions .github/workflows/markdown_linter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: markdown_linter
on:
push:
branches:
- main
pull_request:
schedule:
- cron: "0 0 * * 0"

jobs:
markdown-link-check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- uses: gaurav-nelson/github-action-markdown-link-check@v1
markdown_lint:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [ 14.x ]
steps:
- uses: actions/checkout@master
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- name: Install dependencies
run: npm install --global markdownlint-cli2
- name: Run lint check
run: markdownlint-cli2-fix "**/*.md"
15 changes: 15 additions & 0 deletions .markdownlint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Rules for markdownlint-cli2 (https://github.com/DavidAnson/markdownlint-cli2)
# Based on markdownlint library (https://github.com/DavidAnson/markdownlint)
# (same linter as vscode-markdownlint).
# See rules descriptions here:
# https://github.com/DavidAnson/markdownlint/blob/main/doc/Rules.md
#
first-line-heading: false
line_length: # MD013 max line length
tables: false # don't break tables
code_blocks: false # don't break on code blocks
line_length: 80
html: # MD033 no html
allowed_elements: [br]
images: false # MD045: image alt text
no-blanks-blockquote: false # MD028
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,26 +5,26 @@ deserialization.

## json_serializable [![Pub Package](https://img.shields.io/pub/v/json_serializable.svg)](https://pub.dev/packages/json_serializable)

* Package: https://pub.dev/packages/json_serializable
* [Source code](json_serializable)
- Package: <https://pub.dev/packages/json_serializable>
- [Source code](json_serializable)

The core package providing Generators for JSON-specific tasks.

Import it into your pubspec `dev_dependencies:` section.

## json_annotation [![Pub Package](https://img.shields.io/pub/v/json_annotation.svg)](https://pub.dev/packages/json_annotation)

* Package: https://pub.dev/packages/json_annotation
* [Source code](json_annotation)
- Package: <https://pub.dev/packages/json_annotation>
- [Source code](json_annotation)

The annotation package which has no dependencies.

Import it into your pubspec `dependencies:` section.

## checked_yaml [![Pub Package](https://img.shields.io/pub/v/checked_yaml.svg)](https://pub.dev/packages/checked_yaml)

* Package: https://pub.dev/packages/checked_yaml
* [Source code](checked_yaml)
- Package: <https://pub.dev/packages/checked_yaml>
- [Source code](checked_yaml)

Generate more helpful exceptions when decoding YAML documents using
`package:json_serializable` and `package:yaml`.
Expand All @@ -33,7 +33,7 @@ Import it into your pubspec `dependencies:` section.

## example

* [Source code](example)
- [Source code](example)

An example showing how to setup and use `json_serializable` and
`json_annotation`.
Expand Down
2 changes: 1 addition & 1 deletion checked_yaml/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ the target type.

[`package:json_serializable`] can generate classes that can parse the
[`YamlMap`] type provided by [`package:yaml`] when `anyMap: true` is specified
for the class annotation.
for the class annotation.

```dart
@JsonSerializable(
Expand Down
9 changes: 5 additions & 4 deletions example/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
*This example assumes you're using a recent version of the Dart or Flutter SDK.*
_This example assumes you're using a recent version of the Dart or Flutter SDK._

To use [package:json_serializable][json_serializable] in your package, add these
dependencies to your `pubspec.yaml`.
Expand All @@ -15,10 +15,10 @@ dev_dependencies:
Annotate your code with classes defined in
[package:json_annotation][json_annotation].

* See [`lib/example.dart`][example] for an example of a file using these
- See [`lib/example.dart`][example] for an example of a file using these
annotations.

* See [`lib/example.g.dart`][example_g] for the generated file.
- See [`lib/example.g.dart`][example_g] for the generated file.

Run `pub run build_runner build` to generate files into your source directory.

Expand All @@ -32,7 +32,8 @@ Run `pub run build_runner build` to generate files into your source directory.
[INFO] Build: Succeeded after 4687ms with 1 outputs
```

*NOTE*: If you're using Flutter, replace `pub run` with `flutter packages pub run`.
_NOTE_: If you're using Flutter, replace `pub run` with
`flutter packages pub run`.

[example]: lib/example.dart
[example_g]: lib/example.g.dart
Expand Down

0 comments on commit 8c1a3bd

Please sign in to comment.