Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge package:string_scanner #1658

Merged
merged 103 commits into from
Dec 17, 2024
Merged
Show file tree
Hide file tree
Changes from 102 commits
Commits
Show all changes
103 commits
Select commit Hold shift + click to select a range
1114fad
Add a string_scanner package.
nex3 Apr 2, 2014
e15bced
Convert shelf to use the string_scanner package.
nex3 Apr 2, 2014
7117aa3
Fix the StringScanner tests under dart2js.
nex3 Apr 3, 2014
075137e
Add LineScanner and SpanScanner classes to string_scanner.
nex3 May 30, 2014
80a0a03
Make StringScannerException extend SpanFormatException.
nex3 Jun 23, 2014
a3708fa
Move a number of packages and some of pub over to using source_span.
nex3 Jul 23, 2014
34d0e8f
Add SpanScanner.location.
nex3 Oct 29, 2014
f82411c
Add StringScanner.substring.
nex3 Nov 5, 2014
62e2a3c
Add an additional optional argument to SpanScanner.spanFrom.
nex3 Dec 12, 2014
e3f991b
Add gitignore, status, and codereview files.
nex3 Dec 18, 2014
a2fc778
Update the pubspec's homepage link.
nex3 Dec 18, 2014
4b44fc6
code format, expanded dependency constraint on unittest,
kevmoo Mar 30, 2015
2f43e83
Upgrade to the new test runner.
nex3 Jul 16, 2015
8712d08
Properly handle CR LF in LineScanner.
nex3 Sep 2, 2015
ab2cd25
Increase the SDK constraint to allow ^ constraints.
nex3 Sep 2, 2015
5d9076b
Add new SpanScanner.eager().
nex3 Sep 2, 2015
9e8e6a4
Get rid of all the library tags.
nex3 Jan 13, 2016
aadec1a
Remove the dependency on "path".
nex3 Jan 15, 2016
5a2ea3e
Declare this package strong-mode clean.
nex3 Apr 1, 2016
0ccf8a0
Add SpanScanner.within().
nex3 Jun 6, 2016
1518a7a
Add StringScanner.scanChar() and .expectChar().
nex3 Jun 6, 2016
579891a
Add breaking changes and release 1.0.0.
nex3 Jun 14, 2016
553513c
Fix the expectChar() error text. (dart-lang/string_scanner#3)
nex3 Nov 2, 2016
d8016d4
Don't crash on surrogate pairs. (dart-lang/string_scanner#5)
nex3 May 22, 2017
e036c2e
Enable Travis-CI (dart-lang/string_scanner#7)
kevmoo Mar 1, 2018
c464dd5
chore: set max SDK version to <3.0.0 (dart-lang/string_scanner#10)
chalin Jul 18, 2018
aca34f6
Annotate method error with alwaysThrows annotation. (dart-lang/string…
keertip Aug 3, 2018
bcf5a0a
Update .gitignore to new `dart_tool` pub cache (dart-lang/string_scan…
bcko Aug 13, 2018
15977bb
Fix changelog for release (dart-lang/string_scanner#13)
kevmoo Aug 13, 2018
af64d42
Enable and fix a number of lints, test on oldest supported SDK (dart-…
kevmoo May 6, 2019
24174b8
Remove unneeded codereview.settings
kevmoo Jul 31, 2019
3ce0df0
Remove very old work-around
kevmoo Jul 31, 2019
20a000b
Remove and fix dead links in changelog
kevmoo Jul 31, 2019
f0cc5da
Added example/example.dart, update README to working, valid code
kevmoo Jul 31, 2019
f4b2fb6
analysis_options: disallow implicit casts
kevmoo Jul 31, 2019
3b93ffe
prepare for release
kevmoo Jul 31, 2019
43c11d2
Fix latest pedantic lints, remove deprecated author field in pubspec …
kevmoo Dec 5, 2019
c9b3111
Remove lints duplicated in pkg:pedantic
kevmoo Mar 9, 2020
2f624e5
Enable and fix a number of lints
kevmoo Mar 9, 2020
cf713fe
Fix readme
kevmoo Mar 9, 2020
7bd4cda
Merge the null_safety branch into master (dart-lang/string_scanner#22)
jakemac53 Jul 16, 2020
9a6ecc8
update for the 2.10 dev sdk (dart-lang/string_scanner#23)
jakemac53 Jul 22, 2020
91f74c8
Delete .test_config
kevmoo Jul 28, 2020
bd748d6
Update Travis-CI config to use dev channel (dart-lang/string_scanner#24)
kevmoo Jul 28, 2020
d880864
fix formatting for latest dev SDK
kevmoo Sep 4, 2020
5b24ebd
Prepare for the 2.11 dev SDKs (dart-lang/string_scanner#25)
natebosch Sep 22, 2020
cf16918
allow the 2.12 prerelease sdks (dart-lang/string_scanner#26)
jakemac53 Oct 23, 2020
1c3b953
remove dep overrides (dart-lang/string_scanner#27)
jakemac53 Oct 23, 2020
a9f33b0
Bump SDK constraints for pub (dart-lang/string_scanner#28)
natebosch Nov 3, 2020
d092aad
remove redundant experiment (dart-lang/string_scanner#31)
pq Nov 11, 2020
d769b0e
Remove dependency on package:charcode (dart-lang/string_scanner#29)
natebosch Nov 16, 2020
85f4f74
Migrate to GitHub Actions (dart-lang/string_scanner#32)
athomas Jan 20, 2021
4bbbff2
Revert "Remove dependency on package:charcode (dart-lang/string_scann…
natebosch Jan 29, 2021
e058049
Prepare for stable release of null safety (dart-lang/string_scanner#34)
natebosch Feb 2, 2021
5709729
Revert "Revert "Remove dependency on package:charcode (dart-lang/stri…
natebosch Feb 5, 2021
cbcb9de
Update LICENSE (dart-lang/string_scanner#37)
franklinyow Apr 1, 2021
ce86c26
add dependabot
kevmoo Jun 5, 2021
74bcd12
Bump dart-lang/setup-dart from 0.3 to 1 (dart-lang/string_scanner#38)
dependabot[bot] Jun 5, 2021
3f71285
changed "< 0" to ".isNegative" (dart-lang/string_scanner#39)
Jun 14, 2021
94659c4
Move to pkg:lints (dart-lang/string_scanner#41)
kevmoo Oct 3, 2021
4fc1244
Bump actions/checkout from 2 to 3 (dart-lang/string_scanner#42)
dependabot[bot] Mar 2, 2022
23f9f81
populate the pubspec repository field (dart-lang/string_scanner#44)
devoncarew May 3, 2022
99e9344
rev to 1.1.1 in preparation for publishing (dart-lang/string_scanner#45)
devoncarew May 12, 2022
9e63a33
Add better support for dealing with supplemental-plane code units (da…
nex3 Jun 2, 2022
aa3ac44
Remove deprecated experimental invariant_booleans lint rule (dart-lan…
srawlins Jul 25, 2022
dcbb21f
Update minimum SDK, latest pkg:lints, update CI actions (dart-lang/st…
kevmoo Oct 25, 2022
dfed9c2
Make code in readme consistent with example (dart-lang/string_scanner…
kevmoo Oct 31, 2022
a42fdf8
Bump actions/checkout from 3.1.0 to 3.2.0 (dart-lang/string_scanner#50)
dependabot[bot] Dec 28, 2022
3062f65
Remove unnecessary parens (dart-lang/string_scanner#51)
kevmoo Dec 29, 2022
d019da9
Bump actions/checkout from 3.2.0 to 3.3.0 (dart-lang/string_scanner#52)
dependabot[bot] Jan 6, 2023
e899d5a
dependabot: monthly is plenty (dart-lang/string_scanner#54)
kevmoo Jan 17, 2023
c0e8fe5
Bump dart-lang/setup-dart from 1.3 to 1.4 (dart-lang/string_scanner#53)
dependabot[bot] Jan 30, 2023
25b9b3a
Bump actions/checkout from 3.3.0 to 3.5.0 (dart-lang/string_scanner#55)
dependabot[bot] Apr 3, 2023
3964b97
Bump dart-lang/setup-dart from 1.4.0 to 1.5.0 (dart-lang/string_scann…
dependabot[bot] Apr 3, 2023
34b2616
Bump actions/checkout from 3.5.0 to 3.5.2 (dart-lang/string_scanner#57)
dependabot[bot] May 8, 2023
419ff89
blast_repo fixes (dart-lang/string_scanner#58)
devoncarew May 19, 2023
453f764
Bump actions/checkout from 3.5.2 to 3.5.3 (dart-lang/string_scanner#59)
dependabot[bot] Jul 1, 2023
d88e5fd
blast_repo fixes (dart-lang/string_scanner#60)
kevmoo Jul 18, 2023
c3f7513
Require Dart 3, update lints (dart-lang/string_scanner#61)
kevmoo Jul 18, 2023
e18bdfb
Bump actions/checkout from 3.5.3 to 3.6.0 (dart-lang/string_scanner#62)
dependabot[bot] Sep 1, 2023
3583f10
Bump dart-lang/setup-dart from 1.5.0 to 1.5.1 (dart-lang/string_scann…
dependabot[bot] Oct 1, 2023
de978a5
Bump actions/checkout from 3.6.0 to 4.1.0 (dart-lang/string_scanner#64)
dependabot[bot] Oct 3, 2023
b84c6cf
Bump dart-lang/setup-dart from 1.5.1 to 1.6.0 (dart-lang/string_scann…
dependabot[bot] Nov 1, 2023
ed7eaa8
Bump actions/checkout from 4.1.0 to 4.1.1 (dart-lang/string_scanner#65)
dependabot[bot] Nov 1, 2023
b30d7f7
Update to latest lints and cleanup (dart-lang/string_scanner#67)
kevmoo Dec 4, 2023
5c80b48
Bump dart-lang/setup-dart from 1.6.0 to 1.6.2 (dart-lang/string_scann…
dependabot[bot] Feb 1, 2024
5d1f4fc
Bump actions/checkout from 4.1.1 to 4.1.2 (dart-lang/string_scanner#70)
dependabot[bot] Apr 1, 2024
2b9a8ca
Bump dart-lang/setup-dart from 1.6.2 to 1.6.4 (dart-lang/string_scann…
dependabot[bot] May 1, 2024
c67ff10
Bump actions/checkout from 4.1.2 to 4.1.4 (dart-lang/string_scanner#71)
dependabot[bot] May 1, 2024
514bba1
blast_repo fixes (dart-lang/string_scanner#73)
devoncarew May 13, 2024
ff06b0c
Bump actions/checkout from 4.1.4 to 4.1.5 in the github-actions group…
dependabot[bot] May 13, 2024
a81f3ce
Bump actions/checkout from 4.1.5 to 4.1.6 in the github-actions group…
dependabot[bot] Jun 1, 2024
8664c4a
update lints, require Dart 3.1 (dart-lang/string_scanner#76)
kevmoo Jun 20, 2024
fa4c694
Bump the github-actions group with 2 updates (dart-lang/string_scanne…
dependabot[bot] Jul 1, 2024
a841233
Add a `SpanScanner.spanFromPosition()` method (dart-lang/string_scann…
nex3 Jul 9, 2024
0d71bec
Bump actions/checkout from 4.1.7 to 4.2.0 in the github-actions group…
dependabot[bot] Oct 1, 2024
5916da2
Avoid treating /r as newline on it (dart-lang/string_scanner#81)
DanTup Oct 9, 2024
f876f9d
blast_repo fixes (dart-lang/string_scanner#83)
kevmoo Oct 29, 2024
8c0f565
Bump actions/checkout from 4.2.0 to 4.2.2 in the github-actions group…
dependabot[bot] Nov 1, 2024
b47d77a
Bump dart-lang/setup-dart in the github-actions group (dart-lang/stri…
dependabot[bot] Dec 1, 2024
23e93f8
Merge package:string_scanner into the tools monorepo
mosuem Dec 11, 2024
696b3f2
Add issue template and other fixes
mosuem Dec 11, 2024
c72a0ae
Add changelog
mosuem Dec 17, 2024
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
5 changes: 5 additions & 0 deletions .github/ISSUE_TEMPLATE/string_scanner.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
name: "package:string_scanner"
about: "Create a bug or file a feature request against package:string_scanner."
labels: "package:string_scanner"
---
16 changes: 16 additions & 0 deletions pkgs/string_scanner/.github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Set update schedule for GitHub Actions
# See https://docs.github.com/en/free-pro-team@latest/github/administering-a-repository/keeping-your-actions-up-to-date-with-dependabot

version: 2
updates:

- package-ecosystem: github-actions
directory: /
schedule:
interval: monthly
labels:
- autosubmit
groups:
github-actions:
patterns:
- "*"
17 changes: 17 additions & 0 deletions pkgs/string_scanner/.github/workflows/publish.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# A CI configuration to auto-publish pub packages.

name: Publish

on:
pull_request:
branches: [ master ]
push:
tags: [ 'v[0-9]+.[0-9]+.[0-9]+' ]

jobs:
publish:
if: ${{ github.repository_owner == 'dart-lang' }}
uses: dart-lang/ecosystem/.github/workflows/publish.yaml@main
permissions:
id-token: write # Required for authentication using OIDC
pull-requests: write # Required for writing the pull request note
64 changes: 64 additions & 0 deletions pkgs/string_scanner/.github/workflows/test-package.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
name: Dart CI

on:
# Run on PRs and pushes to the default branch.
push:
branches: [ master ]
pull_request:
branches: [ master ]
schedule:
- cron: "0 0 * * 0"

env:
PUB_ENVIRONMENT: bot.github

jobs:
# Check code formatting and static analysis on a single OS (linux)
# against Dart dev.
analyze:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
sdk: [dev]
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
- uses: dart-lang/setup-dart@e630b99d28a3b71860378cafdc2a067c71107f94
with:
sdk: ${{ matrix.sdk }}
- id: install
name: Install dependencies
run: dart pub get
- name: Check formatting
run: dart format --output=none --set-exit-if-changed .
if: always() && steps.install.outcome == 'success'
- name: Analyze code
run: dart analyze --fatal-infos
if: always() && steps.install.outcome == 'success'

# Run tests on a matrix consisting of two dimensions:
# 1. OS: ubuntu-latest, (macos-latest, windows-latest)
# 2. release channel: dev
test:
needs: analyze
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
# Add macos-latest and/or windows-latest if relevant for this package.
os: [ubuntu-latest]
sdk: [3.1, dev]
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
- uses: dart-lang/setup-dart@e630b99d28a3b71860378cafdc2a067c71107f94
with:
sdk: ${{ matrix.sdk }}
- id: install
name: Install dependencies
run: dart pub get
- name: Run VM tests
run: dart test --platform vm
if: always() && steps.install.outcome == 'success'
- name: Run Chrome tests
run: dart test --platform chrome
if: always() && steps.install.outcome == 'success'
5 changes: 5 additions & 0 deletions pkgs/string_scanner/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Don’t commit the following directories created by pub.
.dart_tool/
.pub/
.packages
pubspec.lock
171 changes: 171 additions & 0 deletions pkgs/string_scanner/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,171 @@
## 1.4.0
mosuem marked this conversation as resolved.
Show resolved Hide resolved

* Fix `LineScanner`'s handling of `\r\n`'s to preventing errors scanning
zero-length matches when between CR and LF. CR is treated as a new line only
if not immediately followed by a LF.
* Fix `LineScanner`'s updating of `column` when setting `position` if the
current position is not `0`.

## 1.3.0

* Require Dart 3.1.0

* Add a `SpanScanner.spanFromPosition()` method which takes raw code units
rather than `SpanScanner.spanFrom()`'s `LineScannerState`s.

## 1.2.0

* Require Dart 2.18.0

* Add better support for reading code points in the Unicode supplementary plane:

* Added `StringScanner.readCodePoint()`, which consumes an entire Unicode code
point even if it's represented by two UTF-16 code units.

* Added `StringScanner.peekCodePoint()`, which returns an entire Unicode code
point even if it's represented by two UTF-16 code units.

* `StringScanner.scanChar()` and `StringScanner.expectChar()` will now
properly consume two UTF-16 code units if they're passed Unicode code points
in the supplementary plane.

## 1.1.1

* Populate the pubspec `repository` field.
* Switch to `package:lints`.
* Remove a dependency on `package:charcode`.

## 1.1.0

* Stable release for null safety.

## 1.1.0-nullsafety.3

* Update SDK constraints to `>=2.12.0-0 <3.0.0` based on beta release
guidelines.

## 1.1.0-nullsafety.2

* Allow prerelease versions of the 2.12 sdk.

## 1.1.0-nullsafety.1

- Allow 2.10 stable and 2.11.0 dev SDK versions.

## 1.1.0-nullsafety

- Migrate to null safety.

## 1.0.5

- Added an example.

- Update Dart SDK constraint to `>=2.0.0 <3.0.0`.

## 1.0.4

* Add @alwaysThrows annotation to error method.

## 1.0.3

* Set max SDK version to `<3.0.0`, and adjust other dependencies.

## 1.0.2

* `SpanScanner` no longer crashes when creating a span that contains a UTF-16
surrogate pair.

## 1.0.1

* Fix the error text emitted by `StringScanner.expectChar()`.

## 1.0.0

* **Breaking change**: `StringScanner.error()`'s `length` argument now defaults
to `0` rather than `1` when no match data is available.

* **Breaking change**: `StringScanner.lastMatch` and related methods are now
reset when the scanner's position changes without producing a new match.

**Note**: While the changes in `1.0.0` are user-visible, they're unlikely to
actually break any code in practice. Unless you know that your package is
incompatible with 0.1.x, consider using 0.1.5 as your lower bound rather
than 1.0.0. For example, `string_scanner: ">=0.1.5 <2.0.0"`.

## 0.1.5

* Add `new SpanScanner.within()`, which scans within a existing `FileSpan`.

* Add `StringScanner.scanChar()` and `StringScanner.expectChar()`.

## 0.1.4+1

* Remove the dependency on `path`, since we don't actually import it.

## 0.1.4

* Add `new SpanScanner.eager()` for creating a `SpanScanner` that eagerly
computes its current line and column numbers.

## 0.1.3+2

* Fix `LineScanner`'s handling of carriage returns to match that of
`SpanScanner`.

## 0.1.3+1

* Fixed the homepage URL.

## 0.1.3

* Add an optional `endState` argument to `SpanScanner.spanFrom`.

## 0.1.2

* Add `StringScanner.substring`, which returns a substring of the source string.

## 0.1.1

* Declare `SpanScanner`'s exposed `SourceSpan`s and `SourceLocation`s to be
`FileSpan`s and `FileLocation`s. They always were underneath, but callers may
now rely on it.

* Add `SpanScanner.location`, which returns the scanner's current
`SourceLocation`.

## 0.1.0

* Switch from `source_maps`' `Span` class to `source_span`'s `SourceSpan` class.

* `new StringScanner()`'s `sourceUrl` parameter is now named to make it clear
that it can be safely `null`.

* `new StringScannerException()` takes different arguments in a different order
to match `SpanFormatException`.

* `StringScannerException.string` has been renamed to
`StringScannerException.source` to match the `FormatException` interface.

## 0.0.3

* Make `StringScannerException` inherit from source_map's `SpanFormatException`.

## 0.0.2

* `new StringScanner()` now takes an optional `sourceUrl` argument that provides
the URL of the source file. This is used for error reporting.

* Add `StringScanner.readChar()` and `StringScanner.peekChar()` methods for
doing character-by-character scanning.

* Scanners now throw `StringScannerException`s which provide more detailed
access to information about the errors that were thrown and can provide
terminal-colored messages.

* Add a `LineScanner` subclass of `StringScanner` that automatically tracks line
and column information of the text being scanned.

* Add a `SpanScanner` subclass of `LineScanner` that exposes matched ranges as
[source map][] `Span` objects.

[source_map]: https://pub.dev/packages/source_maps
27 changes: 27 additions & 0 deletions pkgs/string_scanner/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
Copyright 2014, the Dart project authors.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:

* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above
copyright notice, this list of conditions and the following
disclaimer in the documentation and/or other materials provided
with the distribution.
* Neither the name of Google LLC nor the names of its
contributors may be used to endorse or promote products derived
from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
41 changes: 41 additions & 0 deletions pkgs/string_scanner/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
[![Dart CI](https://github.com/dart-lang/string_scanner/actions/workflows/test-package.yml/badge.svg)](https://github.com/dart-lang/string_scanner/actions/workflows/test-package.yml)
[![pub package](https://img.shields.io/pub/v/string_scanner.svg)](https://pub.dev/packages/string_scanner)
[![package publisher](https://img.shields.io/pub/publisher/string_scanner.svg)](https://pub.dev/packages/string_scanner/publisher)

This package exposes a `StringScanner` type that makes it easy to parse a string
using a series of `Pattern`s. For example:

```dart
import 'dart:math' as math;

import 'package:string_scanner/string_scanner.dart';

num parseNumber(String source) {
// Scan a number ("1", "1.5", "-3").
final scanner = StringScanner(source);

// [Scanner.scan] tries to consume a [Pattern] and returns whether or not it
// succeeded. It will move the scan pointer past the end of the pattern.
final negative = scanner.scan('-');

// [Scanner.expect] consumes a [Pattern] and throws a [FormatError] if it
// fails. Like [Scanner.scan], it will move the scan pointer forward.
scanner.expect(RegExp(r'\d+'));

// [Scanner.lastMatch] holds the [MatchData] for the most recent call to
// [Scanner.scan], [Scanner.expect], or [Scanner.matches].
var number = num.parse(scanner.lastMatch![0]!);

if (scanner.scan('.')) {
scanner.expect(RegExp(r'\d+'));
final decimal = scanner.lastMatch![0]!;
number += int.parse(decimal) / math.pow(10, decimal.length);
}

// [Scanner.expectDone] will throw a [FormatError] if there's any input that
// hasn't yet been consumed.
scanner.expectDone();

return (negative ? -1 : 1) * number;
}
```
32 changes: 32 additions & 0 deletions pkgs/string_scanner/analysis_options.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# https://dart.dev/guides/language/analysis-options
include: package:dart_flutter_team_lints/analysis_options.yaml

analyzer:
language:
strict-casts: true
strict-inference: true
strict-raw-types: true

linter:
rules:
- avoid_bool_literals_in_conditional_expressions
- avoid_classes_with_only_static_members
- avoid_private_typedef_functions
- avoid_redundant_argument_values
- avoid_returning_this
- avoid_unused_constructor_parameters
- avoid_void_async
- cancel_subscriptions
- join_return_with_assignment
- literal_only_boolean_expressions
- missing_whitespace_between_adjacent_strings
- no_adjacent_strings_in_list
- no_runtimeType_toString
- prefer_const_declarations
- prefer_expression_function_bodies
- prefer_final_locals
- unnecessary_await_in_return
- unnecessary_raw_strings
- use_if_null_to_convert_nulls_to_bools
- use_raw_strings
- use_string_buffers
Loading
Loading