mirror of
https://github.com/Yubico/yubioath-flutter.git
synced 2024-11-22 08:22:16 +03:00
Add pre-commit with formatting and linting.
This commit is contained in:
parent
2151902c57
commit
83fda9ddf5
26
.pre-commit-config.yaml
Normal file
26
.pre-commit-config.yaml
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
repos:
|
||||||
|
# Flutter
|
||||||
|
- repo: https://github.com/dluksza/flutter-analyze-pre-commit
|
||||||
|
rev: "4afcaa82fc368d40d486256bf4edba329bf667bb"
|
||||||
|
hooks:
|
||||||
|
- id: flutter-analyze
|
||||||
|
args: [lib/*]
|
||||||
|
- id: dart-format
|
||||||
|
args: [lib/*]
|
||||||
|
|
||||||
|
# Python
|
||||||
|
- repo: https://github.com/PyCQA/flake8
|
||||||
|
rev: 6.1.0
|
||||||
|
hooks:
|
||||||
|
- id: flake8
|
||||||
|
files: helper/
|
||||||
|
- repo: https://github.com/psf/black
|
||||||
|
rev: 23.11.0
|
||||||
|
hooks:
|
||||||
|
- id: black
|
||||||
|
files: helper/
|
||||||
|
- repo: https://github.com/PyCQA/bandit
|
||||||
|
rev: 1.7.5
|
||||||
|
hooks:
|
||||||
|
- id: bandit
|
||||||
|
files: helper/ # keep in sync with .bandit file
|
@ -160,7 +160,8 @@ class _DialogProvider {
|
|||||||
_DDesc.oathDeleteAccount => l10n.s_nfc_dialog_oath_delete_account,
|
_DDesc.oathDeleteAccount => l10n.s_nfc_dialog_oath_delete_account,
|
||||||
_DDesc.oathCalculateCode => l10n.s_nfc_dialog_oath_calculate_code,
|
_DDesc.oathCalculateCode => l10n.s_nfc_dialog_oath_calculate_code,
|
||||||
_DDesc.oathActionFailure => l10n.s_nfc_dialog_oath_failure,
|
_DDesc.oathActionFailure => l10n.s_nfc_dialog_oath_failure,
|
||||||
_DDesc.oathAddMultipleAccounts => l10n.s_nfc_dialog_oath_add_multiple_accounts,
|
_DDesc.oathAddMultipleAccounts =>
|
||||||
|
l10n.s_nfc_dialog_oath_add_multiple_accounts,
|
||||||
_ => ''
|
_ => ''
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -26,4 +26,3 @@ class ApduException implements Exception {
|
|||||||
return 'ApduException[$message; dec: $sw]';
|
return 'ApduException[$message; dec: $sw]';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -14,6 +14,4 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
class CancellationException implements Exception {
|
class CancellationException implements Exception {}
|
||||||
|
|
||||||
}
|
|
||||||
|
@ -61,7 +61,8 @@ class IconPack {
|
|||||||
element.issuer.any((element) => element == issuer.toUpperCase()));
|
element.issuer.any((element) => element == issuer.toUpperCase()));
|
||||||
|
|
||||||
final issuerImageFile = matching.isNotEmpty
|
final issuerImageFile = matching.isNotEmpty
|
||||||
? File(join(directory.path, getLocalIconFileName(matching.first.filename)))
|
? File(
|
||||||
|
join(directory.path, getLocalIconFileName(matching.first.filename)))
|
||||||
: null;
|
: null;
|
||||||
|
|
||||||
if (issuerImageFile != null && !issuerImageFile.existsSync()) {
|
if (issuerImageFile != null && !issuerImageFile.existsSync()) {
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
|
|
||||||
import 'package:flutter/cupertino.dart';
|
import 'package:flutter/cupertino.dart';
|
||||||
import 'package:logging/logging.dart';
|
import 'package:logging/logging.dart';
|
||||||
|
|
||||||
@ -15,4 +14,4 @@ class FocusUtils {
|
|||||||
currentFocus.unfocus();
|
currentFocus.unfocus();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user