2
0
mirror of https://github.com/inventree/inventree-app.git synced 2025-04-27 21:16:48 +00:00

Adds workflow for code linting

This commit is contained in:
Oliver 2021-09-28 12:19:19 +10:00
parent c1a1ef0ad2
commit 037564c6a3
5 changed files with 44 additions and 15 deletions

28
.github/workflows/lint.yaml vendored Normal file
View File

@ -0,0 +1,28 @@
# Run flutter linting checks
name: linting
on:
push:
branches:
- master
pull_request:
branches:
- master
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-java@v1
with:
java-version: '12.x'
- uses: subosito/flutter-action@v1
with:
flutter-version: '2.2.3'
- run: flutter pub get
- run: flutter analyze

8
analysis_options.yaml Normal file
View File

@ -0,0 +1,8 @@
include: package:lint/analysis_options.yaml
linter:
rules:
# ------ Disable individual rules ----- #
# --- #
# Turn off what you don't like. #
# ------------------------------------- #

View File

@ -261,25 +261,10 @@ class _InvenTreeHomePageState extends State<InvenTreeHomePage> {
@override
Widget build(BuildContext context) {
// This method is rerun every time setState is called, for instance as done
// by the _incrementCounter method above.
//
// The Flutter framework has been optimized to make rerunning build methods
// fast, so that you can just rebuild anything that needs updating rather
// than having to individually change instances of widgets.
return Scaffold(
key: _homeKey,
appBar: AppBar(
title: Text(L10().appTitle),
actions: <Widget>[
// IconButton(
// icon: FaIcon(FontAwesomeIcons.barcode),
// tooltip: L10().scanBarcode,
// onPressed: () {
// _scan(context);
// },
// ),
],
),
drawer: new InvenTreeDrawer(context),
body: ListView(

View File

@ -336,6 +336,13 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "0.6.3"
lint:
dependency: "direct dev"
description:
name: lint
url: "https://pub.dartlang.org"
source: hosted
version: "1.6.0"
markdown:
dependency: transitive
description:

View File

@ -48,6 +48,7 @@ dev_dependencies:
flutter_test:
sdk: flutter
flutter_launcher_icons:
lint: ^1.0.0
flutter_icons:
android: true