style: stricter linting

This commit is contained in:
Aleksey Kulikov 2021-12-17 11:20:17 +03:00
parent ae5d895957
commit 7148fbf194
8 changed files with 15 additions and 9 deletions

View file

@ -132,7 +132,7 @@ List<Object> initOptions({
optsC.ref.target_directory = directory.toNativeUtf8().cast<Int8>();
}
List<Pointer<Int8>> pathPointers = [];
var pathPointers = <Pointer<Int8>>[];
Pointer<Pointer<Int8>> strArray = nullptr;
if (paths != null) {
pathPointers = paths.map((e) => e.toNativeUtf8().cast<Int8>()).toList();

View file

@ -336,6 +336,7 @@ bool apply({
if (hunkIndex != null) {
_counter = 0;
const except = -1;
// ignore: omit_local_variable_types
final git_apply_hunk_cb callback = Pointer.fromFunction(_hunkCb, except);
payload = calloc<Int32>()..value = hunkIndex;
opts.ref.payload = payload.cast();
@ -369,6 +370,7 @@ Pointer<git_index> applyToTree({
if (hunkIndex != null) {
_counter = 0;
const except = -1;
// ignore: omit_local_variable_types
final git_apply_hunk_cb callback = Pointer.fromFunction(_hunkCb, except);
payload = calloc<Int32>()..value = hunkIndex;
opts.ref.payload = payload.cast();

View file

@ -160,6 +160,7 @@ int _stashCb(
/// Loop over all the stashed states.
List<Stash> list(Pointer<git_repository> repo) {
const except = -1;
// ignore: omit_local_variable_types
final git_stash_cb callBack = Pointer.fromFunction(_stashCb, except);
libgit2.git_stash_foreach(repo, callBack, nullptr);

View file

@ -41,7 +41,7 @@ class Patch {
}) {
libgit2.git_libgit2_init();
final int flagsInt = flags.fold(0, (acc, e) => acc | e.value);
final flagsInt = flags.fold(0, (int acc, e) => acc | e.value);
if (a is Blob?) {
if (b is Blob?) {

View file

@ -70,7 +70,7 @@ class Repository {
}) {
libgit2.git_libgit2_init();
int flagsInt = flags.fold(0, (acc, e) => acc | e.value);
var flagsInt = flags.fold(0, (int acc, e) => acc | e.value);
if (bare) {
flagsInt |= GitRepositoryInit.bare.value;
@ -1162,7 +1162,7 @@ class Repository {
String? directory,
List<String>? paths,
}) {
final int strat = strategy.fold(0, (acc, e) => acc | e.value);
final strat = strategy.fold(0, (int acc, e) => acc | e.value);
if (refName == null) {
checkout_bindings.index(
@ -1274,7 +1274,7 @@ class Repository {
int contextLines = 3,
int interhunkLines = 0,
}) {
final int flagsInt = flags.fold(0, (acc, e) => acc | e.value);
final flagsInt = flags.fold(0, (int acc, e) => acc | e.value);
if (a is Tree && b is Tree) {
return Diff(

View file

@ -40,7 +40,7 @@ class Stash {
String? message,
Set<GitStash> flags = const {GitStash.defaults},
}) {
final int flagsInt = flags.fold(0, (acc, e) => acc | e.value);
final flagsInt = flags.fold(0, (int acc, e) => acc | e.value);
return Oid(
bindings.save(