A set of commands for coverage tracefiles manipulation.

Overview

Coverage Utils

style: very good analysis License: MIT

A set of commands for coverage info files manipulation.


Installing

$ dart pub global activate --source git https://github.com/mrverdant13/coverde.git

Commands

$ coverde

Coverage info actions.

A set of commands that encapsulate coverage-related functionalities.

Usage: coverde <command> [arguments]

Global options:
-h, --help    Print this usage information.

Available commands:
  filter   Filter a coverage info file.
  remove   Remove a set of files and folders.
  report   Generate the coverage report from a tracefile.
  value    Compute the coverage value (%) of an info file.

Run "coverde help <command>" for more information about a command.

coverde sub-commands

coverde filter

Filter a coverage info file.

Filter the coverage info by ignoring data related to files with paths that matches the given PATTERNS.
The coverage data is taken from the ORIGIN_LCOV_FILE file and the result is appended to the DESTINATION_LCOV_FILE file.

Usage: coverde filter [arguments]
-h, --help                                   Print this usage information.
-i, --ignore-patterns=<PATTERNS>             Set of comma-separated path patterns of the files to be ignored.
                                             Consider that the coverage info of each file is checked as a multiline block.
                                             Each bloc starts with `SF:` and ends with `end_of_record`.
-o, --origin=<ORIGIN_LCOV_FILE>              Origin coverage info file to pick coverage data from.
                                             (defaults to "coverage/lcov.info")
-d, --destination=<DESTINATION_LCOV_FILE>    Destination coverage info file to dump the resulting coverage data into.
                                             (defaults to "coverage/wiped.lcov.info")

Run "coverde help" to see global options.

coverde remove

Remove a set of files and folders.

Usage: coverde remove [arguments]
-h, --help                   Print this usage information.
    --[no-]accept-absence    Accept absence of a file or folder.
                             When an element is not present:
                             - If enabled, the command will continue.
                             - If disabled, the command will fail.
                             (defaults to on)

Run "coverde help" to see global options.

coverde report

Generate the coverage report from a tracefile.

Genrate the coverage report inside REPORT_DIR from the TRACEFILE tracefile.

Usage: coverde report [arguments]
-h, --help                              Print this usage information.
-i, --input-tracefile=<TRACEFILE>       Coverage tracefile to be used for the coverage report generation.
                                        (defaults to "coverage/lcov.info")
-o, --output-report-dir=<REPORT_DIR>    Destination directory where the generated coverage report will be stored.
                                        (defaults to "coverage/html/")

Threshold values (%):
These options provide reference coverage values for the HTML report styling.

High: HIGH_VAL <= coverage <= 100
Medium: MEDIUM_VAL <= coverge < HIGH_VAL
Low: 0 <= coverage < MEDIUM_VAL

    --medium=<MEDIUM_VAL>               Medium threshold.
                                        (defaults to "75")
    --high=<HIGH_VAL>                   High threshold.
                                        (defaults to "90")

Run "coverde help" to see global options.

coverde value

Compute the coverage value (%) of an info file.

Compute the coverage value of the LCOV_FILE info file.

Usage: coverde value [arguments]
-h, --help                Print this usage information.
-f, --file=<LCOV_FILE>    Coverage info file to be used for the coverage value computation.
                          (defaults to "coverage/lcov.info")
-p, --[no-]print-files    Print coverage value for each source file listed in the LCOV_FILE info file.
                          (defaults to on)

Run "coverde help" to see global options.

Comments
  • [RFC] Join all commands under an umbrella command `coverde`

    [RFC] Join all commands under an umbrella command `coverde`

    The current trend in Dart CLI is to have a a single ring to rule them all and the currently, this project has two commands: cov and x.

    Why not to have a coverde command with the following API:

    coverde filter  
    coverde value  
    coverde rm  
    

    If you agree, I would like to send the PR.

    refactor 
    opened by kranfix 2
  • fix: ensure safe dir path construction

    fix: ensure safe dir path construction

    Description

    For folder structures with single child nested folders, the report tool had issues when generating relative paths. This PR ensures relative path construction is safe.

    bug 
    opened by mrverdant13 1
  • feat: ask for confirmation to ovewrite existing file when filtering

    feat: ask for confirmation to ovewrite existing file when filtering

    Description

    At the moment, coverde filter only appends the filtered content to the destination file.

    It would be handy to provide a flag and/or ask for user confirmation to overwrite the destination file content.

    enhancement feature 
    opened by mrverdant13 0
  • feat: add min cov check functionality

    feat: add min cov check functionality

    Description

    For CI workflows, a coverage check step is often used.

    For GitHub there are alternatives like very_good_coverage.

    However, for other repo hosters, there are few or no alternatives at all.

    Alternatives

    Alternative 1

    Add an optional --min option to the coverde value command that allows defining a coverage threshold that will make the execution fail.

    This way, using coverde value --min=90 will fail if the coverage is lower than 90%.

    Alternative 2

    Add the coverde check command with an additional argument that allows defining a coverage threshold that will make the execution fail.

    This way, using coverde check 90 will fail if the coverage is lower than 90%. If no threshold argument is passed, a value of 100(100%) would be used.

    feature 
    opened by mrverdant13 0
  • bug: Different path on filtered result.

    bug: Different path on filtered result.

    The result of the filter command is changing the path to an absolute one, which in turn makes the coverde report command to fail with the error below.

    lcov.info

    SF:lib/cubit/dashboard/dashboard_cubit.dart

    filtered.lcov.info

    SF:/Users/jcquintas/learner_app_flutter/lib/cubit/dashboard/dashboard_cubit.dart

    Error

    FileSystemException: Cannot open file, path = 'Users/jcquintas/learner_app_flutter/lib/cubit/dashboard/dashboard_cubit.dart' (OS Error: No such file or directory, errno = 2)
    #0      _File.throwIfError (dart:io/file_impl.dart:635:7)
    #1      _File.openSync (dart:io/file_impl.dart:479:5)
    #2      _File.readAsBytesSync (dart:io/file_impl.dart:539:18)
    #3      _File.readAsStringSync (dart:io/file_impl.dart:584:18)
    #4      _File.readAsLinesSync (dart:io/file_impl.dart:590:36)
    #5      CovFile.generateSubReport (package:coverde/src/entities/cov_file.dart:179:34)
    #6      CovDir.generateSubReport (package:coverde/src/entities/cov_dir.dart:270:17)
    #7      CovDir.generateSubReport (package:coverde/src/entities/cov_dir.dart:270:17)
    #8      CovDir.generateSubReport (package:coverde/src/entities/cov_dir.dart:270:17)
    #9      CovDir.generateReport (package:coverde/src/entities/cov_dir.dart:190:7)
    #10     ReportCommand.run (package:coverde/src/commands/report/report.dart:169:9)
    #11     CommandRunner.runCommand (package:args/command_runner.dart:209:27)
    #12     CommandRunner.run.<anonymous closure> (package:args/command_runner.dart:119:25)
    #13     new Future.sync (dart:async/future.dart:301:31)
    #14     CommandRunner.run (package:args/command_runner.dart:119:14)
    #15     coverde (package:coverde/src/commands/coverde.dart:24:16)
    #16     main (file:///Users/jcquintas/.pub-cache/hosted/pub.dartlang.org/coverde-0.1.0+1/bin/coverde.dart:10:18)
    #17     _delayEntrypointInvocation.<anonymous closure> (dart:isolate-patch/isolate_patch.dart:295:32)
    #18     _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:192:12)
    

    Commands

    flutter test --coverage
    coverde filter -f '\.g.dart,\.freezed.dart' -m w
    coverde report -i filtered.lcov.info
    
    opened by JCQuintas 0
Releases(coverde-v0.1.0+1)
  • coverde-v0.1.0+1(Dec 2, 2021)

    • FIX: use proper version for update check.
    • DOCS: set README images URLs.
    • FEAT: create check command.
    • FEAT: create filter command.
    • FEAT: create remove command.
    • FEAT: create report command.
    • FEAT: create value command.
    • TEST: ensure 100% test coverage.
    Source code(tar.gz)
    Source code(zip)
Owner
Karlo Verde
Karlo Verde
Utility Manager Flutter Application is made with Flutter and Supabase which allows user to add task, set remainder to the task, set color to separate tasks and it allows to add URL with URL's informations.

Utility Manager Flutter Application! Utility Manager Flutter Application is made with Flutter and Supabase which allows user to add task, set remainde

Kathirvel Chandrasekaran 6 Jan 6, 2022
A set of real world timelines to showcase the use of timeline_tile package, built with Flutter.

beatiful_timelines Beautiful timelines built with Flutter and timeline_tile. Current examples: Timeline Showcase Football Timeline Activity Timeline S

null 233 Dec 21, 2022
Windows95 UI components for Flutter apps. Bring back the nostalgic look and feel of old operating systems with this set of UI components ready to use.

Flutter95 Windows95 UI components for Flutter apps. UNDER CONSTRUCTION Screenshots Components Scaffold95 Scaffold as a Windows95 styled window. Provid

Miguel Beltran 141 Jan 2, 2023
how to set up for run the application on desktop

e_learning_app A new Flutter project. Getting Started This project is a starting point for a Flutter application. A few resources to get you started i

FlutterDevs 11 Nov 1, 2022
Calculates the convex hull of a given set of points.

Calculates the convex hull of a given set of points. Monotone chain is used as algorithm. Info Given a set of points, the convex hull is a subset of p

Daniel 2 Sep 7, 2022
A set of commands for coverage info files manipulation.

Coverage Utils A set of commands for coverage info files manipulation. Installing $ dart pub global activate

Karlo Verde 22 Oct 9, 2022
The Integration Test Helper has pre-configured methods that allow for faster test deployment for end to end (e2e) test coverage.

The Integration Test Helper has pre-configured methods that allow for faster test deployment for end to end (e2e) test coverage (using Android and iOS

The Mobile Applications Community 2 Apr 7, 2022
A package script for allowing coverage test tool to see all Dart files

full_coverage Coverage tools like codecov only see the files that were actually triggered by tests. This means that a coverage of 100% can easily be a

Flutterando 2 Mar 18, 2022
A CLI tool to verify the test coverage of a pull request only, ignoring the rest of the project

This is a CI tool that analyzes the coverage rate of a pull request, ignoring the lines that were not changed in the PR. Motivation The coverage rate

Tales Barreto 3 Dec 15, 2022
Enhanced pub package commands.

Enhanced pub package commands. Add latest resolvable package Remove dependency View package info Like/unlike/view liked pub.dev packages Improved conf

Leo Farias 14 Oct 19, 2022
Statistics Dart package for easy and efficient data manipulation with many built-in functions and units.

statistics Statistics package for easy and efficient data manipulation with many built-in mathematical functions and units. Usage Numeric extension: i

Graciliano Monteiro Passos 13 Nov 7, 2022
A library for YAML manipulation with comment and whitespace preservation.

Yaml Editor A library for YAML manipulation while preserving comments. Usage A simple usage example: import 'package:yaml_edit/yaml_edit.dart'; void

Dart 17 Dec 26, 2022
A comprehensive, cross-platform path manipulation library for Dart.

A comprehensive, cross-platform path manipulation library for Dart. The path package provides common operations for manipulating paths: joining, split

Dart 159 Dec 29, 2022
ThemeX is an easy theme manipulation. Only inform primary color and the ThemeX generate all color combination palette for you

ThemeX is an easy theme manipulation basied on Material Design. Only inform primary color and the ThemeX generate all color combination palette for yo

Michael S. Lopes 2 Jan 31, 2022
Turtle graphics for Flutter. It simply uses a custom painter to draw graphics by a series of Logo-like commands.

flutter_turtle flutter_turtle is a simple implementation of turtle graphics for Flutter. It simply uses a custom painter to draw graphics by a series

Weizhong Yang a.k.a zonble 46 Dec 16, 2022
A Flutter Plugin to check Android device Root status and execute shell commands with root privileges

root plugin A Flutter Plugin to check Android device Root status and Run shell commands in android(only). This plugin is based on Topjohnwu libsu and

Gokulprasanth 12 Nov 15, 2022
Flutter POS Printer - A library to discover printers, and send printer commands

Flutter POS Printer - A library to discover printers, and send printer commands

Nguyễn Đức Hiếu 2 Oct 5, 2022
Utility Manager Flutter Application is made with Flutter and Supabase which allows user to add task, set remainder to the task, set color to separate tasks and it allows to add URL with URL's informations.

Utility Manager Flutter Application! Utility Manager Flutter Application is made with Flutter and Supabase which allows user to add task, set remainde

Kathirvel Chandrasekaran 6 Jan 6, 2022
A simple widget for animating a set of images with full custom controls as an alternative to using a GIF file.

image_sequence_animator A simple widget for animating a set of images with full custom controls as an alternative to using a GIF file. If you have a G

AliYigitBireroglu 134 Dec 22, 2022
A set of real world timelines to showcase the use of timeline_tile package, built with Flutter.

beatiful_timelines Beautiful timelines built with Flutter and timeline_tile. Current examples: Timeline Showcase Football Timeline Activity Timeline S

null 233 Dec 21, 2022