Skip to content

Commit 2c91ddb

Browse files
committed
Merge package:fixnum into the core monorepo
2 parents 5876246 + d1f7c10 commit 2c91ddb

20 files changed

+3551
-0
lines changed

pkgs/fixnum/.github/dependabot.yml

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

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

pkgs/fixnum/CONTRIBUTING.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# How to contribute
2+
3+
### Sign our Contributor License Agreement (CLA)
4+
5+
Even for small changes, we ask that you please sign the CLA electronically
6+
[here](https://developers.google.com/open-source/cla/individual).
7+
The CLA is necessary because you own the copyright to your changes, even
8+
after your contribution becomes part of our codebase, so we need your permission
9+
to use and distribute your code. You can find more details
10+
[here](https://code.google.com/p/dart/wiki/Contributing).

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: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
[![Dart CI](https://github.com/dart-lang/fixnum/actions/workflows/test-package.yml/badge.svg)](https://github.com/dart-lang/fixnum/actions/workflows/test-package.yml)
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.
10+
11+
## Publishing automation
12+
13+
For information about our publishing automation and release process, see
14+
https://github.com/dart-lang/ecosystem/wiki/Publishing-automation.

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)