From 79e24180cd482d9303d44ac6e83e4cfc1a294e81 Mon Sep 17 00:00:00 2001 From: Devon Carew Date: Wed, 25 Jan 2023 15:53:58 -0800 Subject: [PATCH 1/4] blast_repo fixes auto-publish --- .github/workflows/publish.yaml | 14 ++++++++++++++ README.md | 5 +++++ 2 files changed, 19 insertions(+) create mode 100644 .github/workflows/publish.yaml diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml new file mode 100644 index 0000000..fcb7ccb --- /dev/null +++ b/.github/workflows/publish.yaml @@ -0,0 +1,14 @@ +# 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 diff --git a/README.md b/README.md index 33bdcc0..332d900 100644 --- a/README.md +++ b/README.md @@ -7,3 +7,8 @@ A fixed-width 32- and 64- bit integer library for Dart. Provides data types for signed 32- and 64-bit integers. The integer implementations in this library are designed to work identically whether executed on the Dart VM or compiled to JavaScript. + +## Publishing automation + +For information about our publishing automation and release process, see +https://github.com/dart-lang/ecosystem/wiki/Publishing-automation. From b60cb26abb54a41ad33f6fe33ffb91d95ee829ff Mon Sep 17 00:00:00 2001 From: Devon Carew Date: Wed, 25 Jan 2023 23:58:27 +0000 Subject: [PATCH 2/4] rev to 1.1.0 --- CHANGELOG.md | 2 +- pubspec.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a7fcd12..8643084 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,4 @@ -## 1.1.0-dev +## 1.1.0 * Add `tryParseRadix`, `tryParseInt` and `tryParseHex` static methods to both `Int32` and `Int64`. diff --git a/pubspec.yaml b/pubspec.yaml index a380bb4..f85528a 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,5 +1,5 @@ name: fixnum -version: 1.1.0-dev +version: 1.1.0 description: >- Library for 32- and 64-bit signed fixed-width integers with consistent behavior between native and JS runtimes. From 9987c580ddad04c753b8ca81c60d5d0e86900b36 Mon Sep 17 00:00:00 2001 From: Devon Carew Date: Thu, 26 Jan 2023 00:04:27 +0000 Subject: [PATCH 3/4] update the sdk to a stable release --- pubspec.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pubspec.yaml b/pubspec.yaml index f85528a..01c2f8a 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -6,7 +6,7 @@ description: >- repository: https://github.com/dart-lang/fixnum environment: - sdk: '>=2.19.0-0 <3.0.0' + sdk: '>=2.19.0 <3.0.0' dev_dependencies: lints: ^1.0.0 From 9cd020a95210ab9725c6957f2bf965b06d85e64d Mon Sep 17 00:00:00 2001 From: Devon Carew Date: Thu, 26 Jan 2023 00:20:08 +0000 Subject: [PATCH 4/4] update the sdks we test against --- .github/workflows/test-package.yml | 5 ++--- CHANGELOG.md | 1 + lib/src/utilities.dart | 8 ++++---- pubspec.yaml | 2 +- test/int64_test.dart | 8 ++++---- 5 files changed, 12 insertions(+), 12 deletions(-) diff --git a/.github/workflows/test-package.yml b/.github/workflows/test-package.yml index 559b14f..26fffe2 100644 --- a/.github/workflows/test-package.yml +++ b/.github/workflows/test-package.yml @@ -20,7 +20,7 @@ jobs: strategy: fail-fast: false matrix: - sdk: [dev, beta] + sdk: [2.19.0, dev] steps: - uses: actions/checkout@755da8c3cf115ac066823e79a1e1788f8940201b - uses: dart-lang/setup-dart@6a218f2413a3e78e9087f638a238f6b40893203d @@ -47,8 +47,7 @@ jobs: matrix: # Add macos-latest and/or windows-latest if relevant for this package. os: [ubuntu-latest] - # TODO(devoncarew): Add `2.19.0` to this once that release is stable - sdk: [dev, beta] + sdk: [2.19.0, dev] steps: - uses: actions/checkout@755da8c3cf115ac066823e79a1e1788f8940201b - uses: dart-lang/setup-dart@6a218f2413a3e78e9087f638a238f6b40893203d diff --git a/CHANGELOG.md b/CHANGELOG.md index 8643084..f731296 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ * Make `Int32` parse functions consistent with documentation (accept leading minus sign, do not accept empty inputs). * Update the minimum SDK constraint to 2.19. +* Update to package:lints 2.0.0. ## 1.0.1 diff --git a/lib/src/utilities.dart b/lib/src/utilities.dart index 45207d7..d603b57 100644 --- a/lib/src/utilities.dart +++ b/lib/src/utilities.dart @@ -16,12 +16,12 @@ int validateRadix(int radix) => /// not a valid digit in any radix in the range 2 through 36. int decodeDigit(int c) { // Hex digit char codes - const int _c0 = 48; // '0'.codeUnitAt(0) - const int _ca = 97; // 'a'.codeUnitAt(0) + const int c0 = 48; // '0'.codeUnitAt(0) + const int ca = 97; // 'a'.codeUnitAt(0) - int digit = c ^ _c0; + int digit = c ^ c0; if (digit < 10) return digit; - int letter = (c | 0x20) - _ca; + int letter = (c | 0x20) - ca; if (letter >= 0) { // Returns values above 36 for invalid digits. // The value is checked against the actual radix where the return diff --git a/pubspec.yaml b/pubspec.yaml index 01c2f8a..3180c25 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -9,5 +9,5 @@ environment: sdk: '>=2.19.0 <3.0.0' dev_dependencies: - lints: ^1.0.0 + lints: ^2.0.0 test: ^1.16.0 diff --git a/test/int64_test.dart b/test/int64_test.dart index 61fb6cf..bb5ac7a 100644 --- a/test/int64_test.dart +++ b/test/int64_test.dart @@ -714,16 +714,16 @@ void main() { }); test('JavaScript 53-bit integer boundary', () { - Int64 _factorial(Int64 n) { + Int64 factorial(Int64 n) { if (n.isZero) { return Int64(1); } else { - return n * _factorial(n - Int64(1)); + return n * factorial(n - Int64(1)); } } - Int64 fact18 = _factorial(Int64(18)); - Int64 fact17 = _factorial(Int64(17)); + Int64 fact18 = factorial(Int64(18)); + Int64 fact17 = factorial(Int64(17)); expect(fact18 ~/ fact17, Int64(18)); });