Skip to content

Commit

Permalink
Dependency updates and formatting cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
parlough committed Feb 7, 2024
1 parent c158e26 commit a77c430
Show file tree
Hide file tree
Showing 6 changed files with 41 additions and 18 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/dart.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ on:
# “At 00:00 (UTC) on Sunday.”
- cron: '0 0 * * 0'
push:
branches: [ master ]
branches: [ master, main ]
pull_request:
branches: [ master ]
branches: [ master, main ]

env:
PUB_ENVIRONMENT: bot.github
Expand All @@ -17,7 +17,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11
- uses: dart-lang/setup-dart@b64355ae6ca0b5d484f0106a033dd1388965d06d
- uses: dart-lang/setup-dart@fedb1266e91cf51be2fdb382869461a434b920a3
with:
sdk: stable
- name: Print Dart version
Expand Down
15 changes: 10 additions & 5 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@

## 1.2.3 (2023-09-11)

- Removed support for `inline class` keyword and added support for `extension type`.
- Removed support for `inline class` keyword and
added support for `extension type`.

## 1.2.2 (2023-06-28)

Expand All @@ -27,18 +28,22 @@

- Added support for class modifiers.
- Added support for some patterns.
- Identifiers preceeding `=>` are no longer coloured as functions/methods if they do not have parens.
- Identifiers preceding `=>` are no longer coloured as
functions/methods if they do not have parens.

## 1.1.1 (2022-12-13)

- Fixed highlighting of names that match some reserved words/classes with a `$` prefix/suffix.
- Fixed highlighting of names that match some
reserved words/classes with a `$` prefix/suffix.

## 1.1.0 (2022-12-07)

- Improved handling of nested type parameters/arguments.
- Improved handling of class declarations with both type arguments and `extends`.
- Improved handling of class declarations with
both type arguments and `extends`.
- Fixed handling of `get` and `set` as function names.

## 1.0.0 (2022-07-26)

- Added an initial version number to the `grammars/dart.json` to help compare versions for projects using a copy of this file.
- Added an initial version number to the `grammars/dart.json` to help
compare versions for projects using a copy of this file.
18 changes: 14 additions & 4 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,23 @@
# How to Contribute

For license agreement and CLA information, contribution workflow information, code reviews, code style, and community guidelines, please see <https://github.com/dart-lang/.github/blob/main/CONTRIBUTING.md>.
For license agreement and CLA information, contribution workflow information,
code reviews, code style, and community guidelines, please see
<https://github.com/dart-lang/.github/blob/main/CONTRIBUTING.md>.


# Adding Tests for Changes

In the `test/test_files` folder are a set of `.dart` files that are parsed using the grammar. Text representations of the results are stored in `test/goldens` and verified by tests. If your changes to the grammar affect the output you will need to regenerate the golden files and commit them to pass the bots.
In the `test/test_files` folder are a set of `.dart` files
that are parsed using the grammar. Text representations of the results
are stored in `test/goldens` and verified by tests.
If your changes to the grammar affect the output you will need to
regenerate the golden files and commit them to pass the bots.

If the existing test files do not already include sample code that covers the changes you are making, you should add new examples first. Regenerating and committing the new examples and updated golden files _before_ making grammar changes will make your changes easier to review, since the PR will then contain a snapshot of both before and after:
If the existing test files do not already include sample code that
covers the changes you are making, you should add new examples first.
Regenerating and committing the new examples and updated golden files
_before_ making grammar changes will make your changes easier to review,
since the PR will then contain a snapshot of both before and after:

1. Add new sample code to `test/test_files` if required
1. Regenerate golden files
Expand All @@ -16,7 +26,7 @@ If the existing test files do not already include sample code that covers the ch
1. Regenerate golden files
1. Commit changes to your branch

## Regenerating Goldens
## Regenerating goldens

To regenerate the golden files, run:

Expand Down
7 changes: 4 additions & 3 deletions readme.md → README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ Used by:
* VS Code's [built-in Dart](https://github.com/microsoft/vscode/tree/main/extensions/dart) basic language support.
* [Dart & Flutter DevTools](https://github.com/flutter/devtools).
* [GitHub](https://github.com) via [Linguist](https://github.com/github/linguist).
* [dart.dev](https://dart.dev) via [Shiki](https://shiki.style).

When updating the grammar, consider raising issues (or PRs) to update the
following files which do not have automated updates from this grammar:
Expand All @@ -26,10 +27,10 @@ following files which do not have automated updates from this grammar:
[highlight.js](https://highlightjs.org/) is web based syntax highlighter that
can syntax highlight `<code>` references on a web page.

* [Dart-specific code](https://github.com/highlightjs/highlight.js/blob/master/src/languages/dart.js)
* [Dart-specific code](https://github.com/highlightjs/highlight.js/blob/main/src/languages/dart.js)
* Used by:
* [DartDoc](https://github.com/dart-lang/dartdoc)
* See https://github.com/dart-lang/dartdoc/tree/master/lib/resources
* See https://github.com/dart-lang/dartdoc/tree/main/lib/resources
* [pub.dev](https://github.com/dart-lang/pub-dev/)
* See https://github.com/dart-lang/pub-dev/tree/master/third_party/highlight

Expand All @@ -38,6 +39,6 @@ can syntax highlight `<code>` references on a web page.
[CodeMirror](https://codemirror.net/) is a web-based editing component
with Dart highlighting support.

* CodeMirror [Dart mode implementation](https://github.com/codemirror/CodeMirror/tree/master/mode/dart)
* CodeMirror 5 [Dart mode implementation](https://github.com/codemirror/codemirror5/tree/master/mode/dart)
* Used by:
* DartPad
7 changes: 7 additions & 0 deletions analysis_options.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
include: package:dart_flutter_team_lints/analysis_options.yaml

analyzer:
language:
strict-raw-types: true
exclude:
- test/test_files/**

linter:
rules:
- prefer_final_in_for_each
- prefer_final_locals
6 changes: 3 additions & 3 deletions pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
name: dart_syntax_highlight
publish_to: none
environment:
sdk: ^3.1.0
sdk: ^3.2.0

dev_dependencies:
collection: ^1.18.0
dart_flutter_team_lints: ^2.1.1
path: ^1.8.3
path: ^1.9.0
string_scanner: ^1.2.0
test: ^1.24.9
test: ^1.25.2

0 comments on commit a77c430

Please sign in to comment.