tomasbjerre / violations-lib

Java library for parsing report files from static code analysis.
Apache License 2.0
148 stars 39 forks source link

dart/flutter analyze #142

Closed twogood closed 2 years ago

twogood commented 2 years ago

How do I know if this format is supported?

The --format=machine seems to be missing for flutter analyze

$ dart analyze --format=machine
INFO|HINT|UNNECESSARY_IMPORT|C:\\Users\\david\\StudioProjects\\bat\\lib\\step_test.dart|1|8|32|The import of 'package:flutter/cupertino.dart' is unnecessary because all of the used elements are also provided by the import of 'package:flutter/material.dart'.
INFO|HINT|UNNECESSARY_IMPORT|C:\\Users\\david\\StudioProjects\\bat\\lib\\step_test_form.dart|1|8|32|The import of 'package:flutter/cupertino.dart' is unnecessary because all of the used elements are also provided by the import of 'package:flutter/material.dart'.
INFO|HINT|UNNECESSARY_IMPORT|C:\\Users\\david\\StudioProjects\\bat\\lib\\step_test_perform.dart|3|8|32|The import of 'package:flutter/cupertino.dart' is unnecessary because all of the used elements are also provided by the import of 'package:flutter/material.dart'.
INFO|HINT|UNNECESSARY_IMPORT|C:\\Users\\david\\StudioProjects\\bat\\lib\\walk_test.dart|1|8|32|The import of 'package:flutter/cupertino.dart' is unnecessary because all of the used elements are also provided by the import of 'package:flutter/material.dart'.
INFO|HINT|UNNECESSARY_IMPORT|C:\\Users\\david\\StudioProjects\\bat\\lib\\walk_test_countdown.dart|3|8|32|The import of 'package:flutter/cupertino.dart' is unnecessary because all of the used elements are also provided by the import of 'package:flutter/material.dart'.
INFO|HINT|UNNECESSARY_IMPORT|C:\\Users\\david\\StudioProjects\\bat\\lib\\walk_test_perform.dart|3|8|32|The import of 'package:flutter/cupertino.dart' is unnecessary because all of the used elements are also provided by the import of 'package:flutter/material.dart'.
$ dart analyze
Analyzing bat...

   info • lib\step_test.dart:1:8 • The import of 'package:flutter/cupertino.dart' is unnecessary because all of the used elements are also provided by the
          import of 'package:flutter/material.dart'. Try removing the import directive. • unnecessary_import
   info • lib\step_test_form.dart:1:8 • The import of 'package:flutter/cupertino.dart' is unnecessary because all of the used elements are also provided by
          the import of 'package:flutter/material.dart'. Try removing the import directive. • unnecessary_import
   info • lib\step_test_perform.dart:3:8 • The import of 'package:flutter/cupertino.dart' is unnecessary because all of the used elements are also provided by
          the import of 'package:flutter/material.dart'. Try removing the import directive. • unnecessary_import
   info • lib\walk_test.dart:1:8 • The import of 'package:flutter/cupertino.dart' is unnecessary because all of the used elements are also provided by the
          import of 'package:flutter/material.dart'. Try removing the import directive. • unnecessary_import
   info • lib\walk_test_countdown.dart:3:8 • The import of 'package:flutter/cupertino.dart' is unnecessary because all of the used elements are also provided
          by the import of 'package:flutter/material.dart'. Try removing the import directive. • unnecessary_import
   info • lib\walk_test_perform.dart:3:8 • The import of 'package:flutter/cupertino.dart' is unnecessary because all of the used elements are also provided by
          the import of 'package:flutter/material.dart'. Try removing the import directive. • unnecessary_import

6 issues found.
$ flutter analyze
Analyzing bat...

   info - The import of 'package:flutter/cupertino.dart' is unnecessary because all of the used elements are also provided by the import of
          'package:flutter/material.dart' - lib\step_test.dart:1:8 - unnecessary_import
   info - The import of 'package:flutter/cupertino.dart' is unnecessary because all of the used elements are also provided by the import of
          'package:flutter/material.dart' - lib\step_test_form.dart:1:8 - unnecessary_import
   info - The import of 'package:flutter/cupertino.dart' is unnecessary because all of the used elements are also provided by the import of
          'package:flutter/material.dart' - lib\step_test_perform.dart:3:8 - unnecessary_import
   info - The import of 'package:flutter/cupertino.dart' is unnecessary because all of the used elements are also provided by the import of
          'package:flutter/material.dart' - lib\walk_test.dart:1:8 - unnecessary_import
   info - The import of 'package:flutter/cupertino.dart' is unnecessary because all of the used elements are also provided by the import of
          'package:flutter/material.dart' - lib\walk_test_countdown.dart:3:8 - unnecessary_import
   info - The import of 'package:flutter/cupertino.dart' is unnecessary because all of the used elements are also provided by the import of
          'package:flutter/material.dart' - lib\walk_test_perform.dart:3:8 - unnecessary_import

6 issues found. (ran in 2.4s)
twogood commented 2 years ago

Format:

SEVERITY|TYPE|ERROR_CODE|FILE_PATH|LINE|COLUMN|LENGTH|ERROR_MESSAGE

tomasbjerre commented 2 years ago

Implemented it like this: https://github.com/tomasbjerre/violations-lib/commit/46dfd1ca444813d1f51d2316b8e39ab0a4708b9c

Released it in this library and violation-comments-to-github-command-line. So it should work the the Github action now.

Open issue again if not working!