Skip to content

Commit 0240a52

Browse files
authored
Merge pull request #137 from dart-lang/merge-fixnum-package
Merge `package:fixnum`
2 parents ade36c4 + 7dff384 commit 0240a52

19 files changed

+3523
-1
lines changed

.github/labeler.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Configuration for .github/workflows/pull_request_label.yaml.
22

3-
"package-args":
3+
"package:args":
44
- changed-files:
55
- any-glob-to-any-file: 'pkgs/args/**'
6+
7+
"package:fixnum":
8+
- changed-files:
9+
- any-glob-to-any-file: 'pkgs/fixnum/**'

.github/workflows/fixnum.yaml

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
name: package:fixnum
2+
3+
on:
4+
# Run CI on pushes to the main branch, and on PRs against main.
5+
push:
6+
branches: [ main ]
7+
paths:
8+
- '.github/workflows/fixnum.yaml'
9+
- 'pkgs/fixnum/**'
10+
pull_request:
11+
branches: [ main ]
12+
paths:
13+
- '.github/workflows/fixnum.yaml'
14+
- 'pkgs/fixnum/**'
15+
schedule:
16+
- cron: "0 0 * * 0"
17+
env:
18+
PUB_ENVIRONMENT: bot.github
19+
20+
defaults:
21+
run:
22+
working-directory: pkgs/fixnum/
23+
24+
jobs:
25+
# Check code formatting and static analysis on a single OS (linux)
26+
# against Dart dev.
27+
analyze:
28+
runs-on: ubuntu-latest
29+
strategy:
30+
fail-fast: false
31+
matrix:
32+
sdk: [3.1.0, dev]
33+
steps:
34+
- uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938
35+
- uses: dart-lang/setup-dart@0a8a0fc875eb934c15d08629302413c671d3f672
36+
with:
37+
sdk: ${{ matrix.sdk }}
38+
- id: install
39+
name: Install dependencies
40+
run: dart pub get
41+
- name: Check formatting
42+
run: dart format --output=none --set-exit-if-changed .
43+
if: always() && steps.install.outcome == 'success'
44+
- name: Analyze code
45+
run: dart analyze --fatal-infos
46+
if: always() && steps.install.outcome == 'success'
47+
48+
# Run tests on a matrix consisting of two dimensions:
49+
# 1. OS: ubuntu-latest, (macos-latest, windows-latest)
50+
# 2. release channel: dev
51+
test:
52+
needs: analyze
53+
runs-on: ${{ matrix.os }}
54+
strategy:
55+
fail-fast: false
56+
matrix:
57+
# Add macos-latest and/or windows-latest if relevant for this package.
58+
os: [ubuntu-latest]
59+
sdk: [3.1.0, dev]
60+
steps:
61+
- uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938
62+
- uses: dart-lang/setup-dart@0a8a0fc875eb934c15d08629302413c671d3f672
63+
with:
64+
sdk: ${{ matrix.sdk }}
65+
- id: install
66+
name: Install dependencies
67+
run: dart pub get
68+
- name: Run VM tests
69+
run: dart test --platform vm
70+
if: always() && steps.install.outcome == 'success'
71+
- name: Run Chrome tests
72+
run: dart test --platform chrome
73+
if: always() && steps.install.outcome == 'success'

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ This repository is home to various Dart packages under the [dart.dev](https://pu
99
| Package | Description | Version |
1010
|---|---|---|
1111
| [args](pkgs/args/) | Library for defining parsers for parsing raw command-line arguments into a set of options and values. | [![pub package](https://img.shields.io/pub/v/args.svg)](https://pub.dev/packages/args) |
12+
| [fixnum](pkgs/fixnum/) | Library for 32- and 64-bit signed fixed-width integers. | [![pub package](https://img.shields.io/pub/v/fixnum.svg)](https://pub.dev/packages/fixnum) |
1213

1314
## Publishing automation
1415

pkgs/fixnum/.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
.dart_tool/
2+
.packages
3+
pubspec.lock

pkgs/fixnum/AUTHORS

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Names should be added to this file with this pattern:
2+
#
3+
# For individuals:
4+
# Name <email address>
5+
#
6+
# For organizations:
7+
# Organization <fnmatch pattern>
8+
#
9+
Google Inc. <*@google.com>

pkgs/fixnum/CHANGELOG.md

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
## 1.1.1
2+
3+
* Require Dart `^3.1.0`
4+
* Move to `dart-lang/core` monorepo.
5+
6+
## 1.1.0
7+
8+
* Add `tryParseRadix`, `tryParseInt` and `tryParseHex` static methods
9+
to both `Int32` and `Int64`.
10+
* Document exception and overflow behavior of parse functions,
11+
and of `toHexString`.
12+
* Make `Int32` parse functions consistent with documentation (accept
13+
leading minus sign, do not accept empty inputs).
14+
* Update the minimum SDK constraint to 2.19.
15+
* Update to package:lints 2.0.0.
16+
17+
## 1.0.1
18+
19+
* Switch to using `package:lints`.
20+
* Populate the pubspec `repository` field.
21+
22+
## 1.0.0
23+
24+
* Stable null safety release.
25+
26+
## 1.0.0-nullsafety.0
27+
28+
* Migrate to null safety.
29+
* This is meant to be mostly non-breaking, for opted in users runtime errors
30+
will be promoted to static errors. For non-opted in users the runtime
31+
errors are still present in their original form.
32+
33+
## 0.10.11
34+
35+
* Update minimum SDK constraint to version 2.1.1.
36+
37+
## 0.10.10
38+
39+
* Fix `Int64` parsing to throw `FormatException` on an empty string or single
40+
minus sign. Previous incorrect behaviour was to throw a `RangeError` or
41+
silently return zero.
42+
43+
## 0.10.9
44+
45+
* Add `Int64.toStringUnsigned()` and `Int64.toRadixStringUnsigned()` functions.
46+
47+
## 0.10.8
48+
49+
* Set SDK version constraint to `>=2.0.0-dev.65 <3.0.0`.
50+
51+
## 0.10.7
52+
53+
* Bug fix: Make bit shifts work at bitwidth boundaries. Previously,
54+
`new Int64(3) << 64 == Int64(3)`. This ensures that the result is 0 in such
55+
cases.
56+
* Updated maximum SDK constraint from 2.0.0-dev.infinity to 2.0.0.
57+
58+
## 0.10.6
59+
60+
* Fix `Int64([int value])` constructor to avoid rounding error on intermediate
61+
results for large negative inputs when compiled to JavaScript. `new
62+
Int64(-1000000000000000000)` used to produce the same value as
63+
`Int64.parseInt("-1000000000000000001")`
64+
65+
## 0.10.5
66+
67+
* Fix strong mode warning in overridden `compareTo()` methods.
68+
69+
*No changelog entries for previous versions...*

pkgs/fixnum/LICENSE

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
Copyright 2014, the Dart project authors.
2+
3+
Redistribution and use in source and binary forms, with or without
4+
modification, are permitted provided that the following conditions are
5+
met:
6+
7+
* Redistributions of source code must retain the above copyright
8+
notice, this list of conditions and the following disclaimer.
9+
* Redistributions in binary form must reproduce the above
10+
copyright notice, this list of conditions and the following
11+
disclaimer in the documentation and/or other materials provided
12+
with the distribution.
13+
* Neither the name of Google LLC nor the names of its
14+
contributors may be used to endorse or promote products derived
15+
from this software without specific prior written permission.
16+
17+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
18+
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
19+
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
20+
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
21+
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
22+
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
23+
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
24+
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
25+
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26+
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
27+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

pkgs/fixnum/README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
[![Dart CI](https://github.com/dart-lang/core/actions/workflows/fixnum.yaml/badge.svg)](https://github.com/dart-lang/core/actions/workflows/fixnum.yaml)
2+
[![Pub](https://img.shields.io/pub/v/fixnum.svg)](https://pub.dev/packages/fixnum)
3+
[![package publisher](https://img.shields.io/pub/publisher/fixnum.svg)](https://pub.dev/packages/fixnum/publisher)
4+
5+
A fixed-width 32- and 64- bit integer library for Dart.
6+
7+
Provides data types for signed 32- and 64-bit integers.
8+
The integer implementations in this library are designed to work identically
9+
whether executed on the Dart VM or compiled to JavaScript.

pkgs/fixnum/analysis_options.yaml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
include: package:dart_flutter_team_lints/analysis_options.yaml
2+
3+
analyzer:
4+
language:
5+
strict-casts: true
6+
7+
linter:
8+
rules:
9+
- avoid_private_typedef_functions
10+
- avoid_unused_constructor_parameters
11+
- cancel_subscriptions
12+
- cascade_invocations
13+
- join_return_with_assignment
14+
- missing_whitespace_between_adjacent_strings
15+
- no_adjacent_strings_in_list
16+
- no_runtimeType_toString
17+
- package_api_docs
18+
- prefer_const_declarations
19+
- prefer_expression_function_bodies
20+
- unnecessary_raw_strings
21+
- use_string_buffers

pkgs/fixnum/lib/fixnum.dart

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2+
// for details. All rights reserved. Use of this source code is governed by a
3+
// BSD-style license that can be found in the LICENSE file.
4+
5+
/// Signed 32- and 64-bit integer support.
6+
///
7+
/// The integer implementations in this library are designed to work
8+
/// identically whether executed on the Dart VM or compiled to JavaScript.
9+
library;
10+
11+
export 'src/int32.dart';
12+
export 'src/int64.dart';
13+
export 'src/intx.dart';

0 commit comments

Comments
 (0)