Skip to content

Commit

Permalink
Fix alternative loop (#8)
Browse files Browse the repository at this point in the history
  • Loading branch information
xvrh authored Nov 11, 2023
1 parent 01669a0 commit d8d1677
Show file tree
Hide file tree
Showing 19 changed files with 447 additions and 244 deletions.
14 changes: 10 additions & 4 deletions .github/workflows/analyze.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,19 @@ jobs:
analyze_and_test:
name: Analyse
runs-on: ubuntu-latest
container:
image: dart:stable
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- uses: dart-lang/setup-dart@v1
with:
sdk: 'stable'
- run: dart --version
- run: dart pub get && (cd example && dart pub get)
- run: dart analyze --fatal-infos
- run: dart --enable-asserts tool/prepare_submit.dart
- name: "check for uncommitted changes"
run: git diff --exit-code --stat -- .
run: |
git diff --exit-code --stat -- . \
|| (echo "##[error] found changed files after build. please run 'dart tool/prepare_submit.dart'" \
"and check in all changes" \
&& exit 1)
shell: bash
31 changes: 7 additions & 24 deletions .github/workflows/publish-on-pub.yaml
Original file line number Diff line number Diff line change
@@ -1,28 +1,11 @@
name: Publish package to pub.dev
name: Publish to pub.dev

on:
push:
tags:
- v*
- 'v[0-9]+.[0-9]+.[0-9]+*'
jobs:
build:
runs-on: ubuntu-latest
container:
image: dart:stable
steps:
- uses: actions/checkout@v2
- run: dart pub get
- run: dart tool/check_version.dart ${GITHUB_REF}
- name: Setup credentials
run: |
mkdir -p ~/.pub-cache
cat <<EOF > ~/.pub-cache/credentials.json
{
"accessToken":"${{ secrets.OAUTH_ACCESS_TOKEN }}",
"refreshToken":"${{ secrets.OAUTH_REFRESH_TOKEN }}",
"tokenEndpoint":"https://accounts.google.com/o/oauth2/token",
"scopes": [ "openid", "https://www.googleapis.com/auth/userinfo.email" ],
"expiration": 1580681402856
}
EOF
- name: Publish package
run: dart pub publish --force
publish:
permissions:
id-token: write # Required for authentication using OIDC
uses: dart-lang/setup-dart/.github/workflows/publish.yml@v1
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
## 0.3.0

- Fix alternative loop syntax
- Fix `<doctype>`

## 0.2.2

- Replace `package:pedantic` with `package:lints`
Expand Down
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ void _productTemplate(Product product) {
@template
void _pageTemplate(Product product, {List<String>? scripts}) {
var script = '';
'<!doctype html>';
'''
<html lang="${Language.current}">
<head>
Expand Down
2 changes: 1 addition & 1 deletion README.template.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import 'example/lib/main.dart#full_example';

#### Generate the code

- `pub run build_runner watch --delete-conflicting-outputs`
- `dart run build_runner watch --delete-conflicting-outputs`

This generates a public function with the same arguments as the original. The generated code looks like:
```dart
Expand Down
3 changes: 1 addition & 2 deletions analysis_options.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@ linter:
constant_identifier_names: true
empty_statements: true
hash_and_equals: true
iterable_contains_unrelated_type: true
list_remove_unrelated_type: true
collection_methods_unrelated_type: true
no_adjacent_strings_in_list: true
non_constant_identifier_names: true
only_throw_errors: true
Expand Down
9 changes: 3 additions & 6 deletions example/lib/condition.g.dart

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

5 changes: 3 additions & 2 deletions example/lib/loop.g.dart

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

1 change: 0 additions & 1 deletion example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ void _productTemplate(Product product) {
@template
void _pageTemplate(Product product, {List<String>? scripts}) {
var script = '';
'<!doctype html>';
'''
<html lang="${Language.current}">
<head>
Expand Down
7 changes: 0 additions & 7 deletions example/lib/main.g.dart

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

18 changes: 7 additions & 11 deletions example/lib/multiple_literals.g.dart

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

Loading

0 comments on commit d8d1677

Please sign in to comment.