Skip to content

Commit ac35cd8

Browse files
committed
style: format all + melos test command
1 parent 1b00d20 commit ac35cd8

File tree

8 files changed

+29
-15
lines changed

8 files changed

+29
-15
lines changed

melos.yaml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,24 @@ scripts:
1515
lint:all:
1616
run: melos run analyze && melos run format
1717
description: Run all static analysis checks.
18+
19+
test:all:
20+
run: |
21+
melos run test --no-select
22+
description: |
23+
Run all tests available.
24+
25+
test:
26+
run: |
27+
melos exec -c 6 --fail-fast -- \
28+
"flutter test --no-pub --no-test-assets"
29+
description: Run `flutter test` for a specific package.
30+
select-package:
31+
dir-exists:
32+
- test
33+
ignore:
34+
- "*web*"
35+
- "*example*"
1836

1937
analyze:
2038
run: |

packages/native_crypto/example/lib/pages/benchmark_page.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,8 @@ class BenchmarkPage extends ConsumerWidget {
9191
after = DateTime.now();
9292
benchmark =
9393
after.millisecondsSinceEpoch - before.millisecondsSinceEpoch;
94-
benchmarkStatus
95-
.appendln('[Benchmark] ${size}MiB => Decryption took $benchmark ms');
94+
benchmarkStatus.appendln(
95+
'[Benchmark] ${size}MiB => Decryption took $benchmark ms');
9696
csvLine.write(';$benchmark');
9797
}
9898
csv += csvLine.toString() + '\n';

packages/native_crypto/example/lib/pages/cipher_page.dart

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
// -----
44
// File: cipher_page.dart
55
// Created Date: 28/12/2021 13:33:15
6-
// Last Modified: 26/05/2022 21:07:54
6+
// Last Modified: 27/05/2022 16:42:10
77
// -----
88
// Copyright (c) 2021
99

@@ -60,8 +60,6 @@ class CipherPage extends ConsumerWidget {
6060
cipherText = CipherTextWrapper.fromBytes(
6161
_altered,
6262
ivLength: AESMode.gcm.ivLength,
63-
messageLength:
64-
_altered.length - (AESMode.gcm.ivLength + AESMode.gcm.tagLength),
6563
tagLength: AESMode.gcm.tagLength,
6664
);
6765
encryptionStatus.print('String successfully encrypted:\n');

packages/native_crypto/lib/src/core/cipher_text.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ class CipherText extends ByteArray {
5252
CipherAlgorithm? cipherAlgorithm,
5353
}) {
5454
messageLength ??= bytes.length - ivLength - tagLength;
55-
55+
5656
if (ivLength.isNegative ||
5757
messageLength.isNegative ||
5858
tagLength.isNegative) {

packages/native_crypto/lib/src/interfaces/cipher.dart

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import 'package:native_crypto/src/utils/cipher_algorithm.dart';
1717
/// In cryptography, a [Cipher] is an algorithm for performing encryption
1818
/// or decryption - a series of well-defined steps that can
1919
/// be followed as a procedure.
20-
///
20+
///
2121
/// This interface is implemented by all the ciphers in NativeCrypto.
2222
abstract class Cipher {
2323
static const int _bytesCountPerChunkDefault = 33554432;
@@ -26,7 +26,7 @@ abstract class Cipher {
2626
/// Returns the default number of bytes per chunk.
2727
static int get defaultBytesCountPerChunk => _bytesCountPerChunkDefault;
2828

29-
/// Returns the size of a chunk of data
29+
/// Returns the size of a chunk of data
3030
/// that can be processed by the [Cipher].
3131
static int get bytesCountPerChunk => Cipher._bytesCountPerChunk;
3232

@@ -35,11 +35,10 @@ abstract class Cipher {
3535
static set bytesCountPerChunk(int bytesCount) {
3636
_bytesCountPerChunk = bytesCount;
3737
}
38-
38+
3939
/// Returns the standard algorithm for this [Cipher].
4040
CipherAlgorithm get algorithm;
4141

42-
4342
/// Encrypts the [data].
4443
///
4544
/// Takes [Uint8List] data as parameter.

packages/native_crypto/lib/src/interfaces/keyderivation.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ import 'package:native_crypto/src/keys/secret_key.dart';
1111
import 'package:native_crypto/src/utils/kdf_algorithm.dart';
1212

1313
/// Represents a Key Derivation Function (KDF) in NativeCrypto.
14-
///
15-
/// [KeyDerivation] function is a function that takes some
14+
///
15+
/// [KeyDerivation] function is a function that takes some
1616
/// parameters and returns a [SecretKey].
1717
abstract class KeyDerivation {
1818
/// Returns the standard algorithm for this key derivation function

packages/native_crypto/test/src/cipher_text_test.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ void main() {
157157
expect(cipherText.cipherAlgorithm, CipherAlgorithm.aes);
158158
});
159159
});
160-
160+
161161
group('Lengths', () {
162162
test('get.ivLength returns the expected value', () {
163163
final CipherText cipherText = CipherText.fromBytes(

packages/native_crypto_platform_interface/test/method_channel/method_channel_native_crypto_test.dart

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ void main() {
150150
],
151151
);
152152
});
153-
153+
154154
test('decrypt', () async {
155155
await nativeCrypto.decrypt(
156156
Uint8List(0),
@@ -171,6 +171,5 @@ void main() {
171171
],
172172
);
173173
});
174-
175174
});
176175
}

0 commit comments

Comments
 (0)