mirror of
https://github.com/SkinnyMind/libgit2dart.git
synced 2025-05-04 20:29:08 -04:00
style: stricter linting
This commit is contained in:
parent
d0f7746a01
commit
2eb50dec69
12 changed files with 47 additions and 27 deletions
|
@ -249,7 +249,7 @@ Pointer<git_reference> createDirect({
|
|||
|
||||
if (error < 0) {
|
||||
calloc.free(out);
|
||||
throw (LibGit2Error(libgit2.git_error_last()));
|
||||
throw LibGit2Error(libgit2.git_error_last());
|
||||
} else {
|
||||
return out.value;
|
||||
}
|
||||
|
@ -309,7 +309,7 @@ Pointer<git_reference> createSymbolic({
|
|||
|
||||
if (error < 0) {
|
||||
calloc.free(out);
|
||||
throw (LibGit2Error(libgit2.git_error_last()));
|
||||
throw LibGit2Error(libgit2.git_error_last());
|
||||
} else {
|
||||
return out.value;
|
||||
}
|
||||
|
|
|
@ -211,12 +211,12 @@ class _ConfigIterator implements Iterator<ConfigEntry> {
|
|||
/// Pointer to memory address for allocated config iterator.
|
||||
final Pointer<git_config_iterator> _iteratorPointer;
|
||||
|
||||
ConfigEntry? _currentEntry;
|
||||
late ConfigEntry _currentEntry;
|
||||
int error = 0;
|
||||
final entry = calloc<Pointer<git_config_entry>>();
|
||||
|
||||
@override
|
||||
ConfigEntry get current => _currentEntry!;
|
||||
ConfigEntry get current => _currentEntry;
|
||||
|
||||
@override
|
||||
bool moveNext() {
|
||||
|
|
|
@ -394,12 +394,12 @@ class _IndexIterator implements Iterator<IndexEntry> {
|
|||
}
|
||||
|
||||
final Pointer<git_index> _indexPointer;
|
||||
IndexEntry? _currentEntry;
|
||||
late IndexEntry _currentEntry;
|
||||
int _index = 0;
|
||||
late final int count;
|
||||
|
||||
@override
|
||||
IndexEntry get current => _currentEntry!;
|
||||
IndexEntry get current => _currentEntry;
|
||||
|
||||
@override
|
||||
bool moveNext() {
|
||||
|
|
|
@ -5,7 +5,9 @@ import 'package:libgit2dart/src/bindings/libgit2_bindings.dart';
|
|||
import 'package:libgit2dart/src/bindings/odb.dart' as odb_bindings;
|
||||
import 'package:libgit2dart/src/bindings/oid.dart' as bindings;
|
||||
import 'package:libgit2dart/src/util.dart';
|
||||
import 'package:meta/meta.dart';
|
||||
|
||||
@immutable
|
||||
class Oid {
|
||||
/// Initializes a new instance of [Oid] class from provided
|
||||
/// pointer to Oid object in memory.
|
||||
|
|
|
@ -280,21 +280,20 @@ class Reference {
|
|||
/// Repository where a reference resides.
|
||||
Repository get owner => Repository(bindings.owner(_refPointer));
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return (other is Reference) &&
|
||||
bindings.compare(
|
||||
ref1Pointer: _refPointer,
|
||||
ref2Pointer: other._refPointer,
|
||||
);
|
||||
/// Compares two references.
|
||||
bool equals(Reference other) {
|
||||
return bindings.compare(
|
||||
ref1Pointer: _refPointer,
|
||||
ref2Pointer: other._refPointer,
|
||||
);
|
||||
}
|
||||
|
||||
/// Compares two references.
|
||||
bool notEquals(Reference other) => !equals(other);
|
||||
|
||||
/// Releases memory allocated for reference object.
|
||||
void free() => bindings.free(_refPointer);
|
||||
|
||||
@override // coverage:ignore-line
|
||||
int get hashCode => _refPointer.address.hashCode; // coverage:ignore-line
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'Reference{name: $name, target: $target, type: $type, '
|
||||
|
|
|
@ -129,12 +129,12 @@ class _RefLogIterator implements Iterator<RefLogEntry> {
|
|||
/// Pointer to memory address for allocated reflog object.
|
||||
final Pointer<git_reflog> _reflogPointer;
|
||||
|
||||
RefLogEntry? _currentEntry;
|
||||
late RefLogEntry _currentEntry;
|
||||
int _index = 0;
|
||||
late final int _count;
|
||||
|
||||
@override
|
||||
RefLogEntry get current => _currentEntry!;
|
||||
RefLogEntry get current => _currentEntry;
|
||||
|
||||
@override
|
||||
bool moveNext() {
|
||||
|
|
|
@ -4,7 +4,9 @@ import 'package:libgit2dart/libgit2dart.dart';
|
|||
import 'package:libgit2dart/src/bindings/libgit2_bindings.dart';
|
||||
import 'package:libgit2dart/src/bindings/signature.dart' as bindings;
|
||||
import 'package:libgit2dart/src/util.dart';
|
||||
import 'package:meta/meta.dart';
|
||||
|
||||
@immutable
|
||||
class Signature {
|
||||
/// Initializes a new instance of [Signature] class from provided pointer to
|
||||
/// signature object in memory.
|
||||
|
|
|
@ -18,7 +18,7 @@ String getLibName() {
|
|||
ext = 'dll';
|
||||
} else if (Platform.isMacOS) {
|
||||
ext = 'dylib';
|
||||
} else if (!(Platform.isLinux)) {
|
||||
} else if (!Platform.isLinux) {
|
||||
throw Exception('Unsupported platform.');
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue