Skip to content

Commit

Permalink
Milestone/v2.0.0 (#18)
Browse files Browse the repository at this point in the history
* chore(deps): bump dart sdk

* feat: implement colored string extension

* chore: reorganize classes

* feat(#15): deprecate executables and use arguments

* misc(): add magenta color

* refactor(#17): part 1

* chore: update gitignore

* chore(): bump dart sdk

* feat(): add grinder tasks

* style(): format code

* docs(#16): update documentation and examples

* refactor(#17): part 2
  • Loading branch information
bcsizmadia authored Sep 9, 2024
1 parent 670ef35 commit 068eab5
Show file tree
Hide file tree
Showing 32 changed files with 490 additions and 400 deletions.
4 changes: 4 additions & 0 deletions .github/dependabot.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,7 @@ updates:
interval: monthly
labels:
- autosubmit
- package-ecosystem: pub
directory: /
schedule:
interval: monthly
11 changes: 7 additions & 4 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,13 @@ Fixes #(issue number)

Please delete options that are not relevant.

- [ ] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
- [ ] This change requires a documentation update
- [ ] 🛠️ Bug fix (non-breaking change which fixes an issue)
- [ ] ✨ New feature (non-breaking change which adds functionality)
- [ ] ❌ Breaking change (fix or feature that would cause existing functionality to not work as expected)
- [ ] 📝 This change requires a documentation update
- [ ] 🧹 Code refactor
- [ ] ✅ Build configuration change
- [ ] 🗑️ Chore

## Checklist:

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
- name: 🎯 Set up Dart SDK
uses: dart-lang/setup-dart@v1
with:
sdk: 3.0.4
sdk: 3.5.1

- name: 📦 Install Dart Dependencies
run: dart pub get
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pull_request.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
- name: 🎯 Set up Dart SDK
uses: dart-lang/setup-dart@v1
with:
sdk: 3.0.4
sdk: 3.5.1

- name: 📦 Install Dart Dependencies
run: dart pub get
Expand Down
13 changes: 13 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
# https://dart.dev/guides/libraries/private-files
# Created by `dart pub`

# Files and directories created by pub
.dart_tool/
.packages
build/
pubspec.lock

# Files generated during tests
.test_coverage.dart
coverage/
.test_runner.dart

# Android studio and IntelliJ
.idea
51 changes: 44 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,45 @@
# Dart Hooks

>Automating the integration and management of Git Hooks in Dart projects.
_Social buttons_

[![errorempire/darthooks](https://img.shields.io/static/v1?label=errorempire&message=DartHooks&color=yellow&logo=github)](https://github.com/errorempire/DartHooks "Go to GitHub repo")
[![stars - DartHooks](https://img.shields.io/github/stars/errorempire/DartHooks?style=social)](https://github.com/errorempire/DartHooks)
[![forks - DartHooks](https://img.shields.io/github/forks/errorempire/DartHooks?style=social)](https://github.com/errorempire/DartHooks)

_Repo metadata_

[![GitHub tag](https://img.shields.io/github/tag/errorempire/DartHooks?include_prereleases=&sort=semver&color=yellow)](https://github.com/errorempire/DartHooks/releases/)
[![License](https://img.shields.io/badge/License-MIT-yellow)](#license)
[![issues - DartHooks](https://img.shields.io/github/issues/errorempire/DartHooks)](https://github.com/errorempire/DartHooks/issues)

- [Dart Hooks](#dart-hooks)
- [Installation](#installation)
- [Getting Started 🚀](#getting-started-)
- [Usage 🔨](#usage-)
- [Features 🎉](#features-)
- [Running grinder tasks 🧪](#running-grinder-tasks-)
- [License](#license)

## Getting Started 🚀

Automating the integration and management of Git Hooks in Dart projects.
If the CLI application is available on [pub.dev](https://pub.dev), install via:

```sh
dart pub add dart_hooks --dev
```

then:

```sh
dart pub get
```

## Usage 🔨

Check out the [examples](https://github.com/errorempire/DartHooks/tree/main/example).

## Features 🎉
Supported SDK:
- **Dart**
- ~~Flutter~~
Expand All @@ -15,12 +48,16 @@ Supported hooks:
- `pre-commit`
- `pre-push`

## Installation
## Running grinder tasks 🧪

```sh
dart pub add dart_hooks --dev
```
Check out the [Grinder](https://pub.dev/packages/grinder) documentation for installation.

To see all available tasks:

```sh
dart pub get
grind --help
```

## License

Released under [MIT](/LICENSE) by [@bcsizmadia](https://github.com/bcsizmadia).
32 changes: 0 additions & 32 deletions bin/apply.dart

This file was deleted.

11 changes: 11 additions & 0 deletions bin/dart_hooks.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import 'package:args/command_runner.dart';
import 'package:dart_hooks/commands/exports.dart';

void main(List<String> args) async {
CommandRunner<String>('dart_hooks',
'DartHooks - Automating the integration and management of Git Hooks in Dart projects')
..addCommand(InitCommand())
..addCommand(ApplyCommand())
..addCommand(DestroyCommand())
..run(args);
}
16 changes: 0 additions & 16 deletions bin/destroy.dart

This file was deleted.

22 changes: 0 additions & 22 deletions bin/init.dart

This file was deleted.

7 changes: 0 additions & 7 deletions bin/pre_commit.dart

This file was deleted.

7 changes: 0 additions & 7 deletions bin/pre_push.dart

This file was deleted.

71 changes: 55 additions & 16 deletions example/README.md
Original file line number Diff line number Diff line change
@@ -1,31 +1,66 @@
# How to Use
# How to Use 🤷

- [How to Use](#how-to-use)
- [Initialize the Config](#initialize-the-config)
- [Applying the Hooks](#applying-the-hooks)
- [Example Config File](#example-config-file)
- [How to Uninstall](#how-to-uninstall)
- [How to Use 🤷](#how-to-use-)
- [How to install 📦](#how-to-install-)
- [Install the package via pub.dev:](#install-the-package-via-pubdev)
- [Development Installation 🛠️](#development-installation-️)
- [Initialize the Config ⚙️](#initialize-the-config-️)
- [Applying the Hooks 🪝](#applying-the-hooks-)
- [Example Config File 📁](#example-config-file-)
- [How to Uninstall 🗑️](#how-to-uninstall-️)

## How to install 📦

## Initialize the Config
### Install the package via [pub.dev](https://pub.dev/packages/dart_hooks):

```sh
dart pub add dart_hooks --dev
```

### Development Installation 🛠️

For development purposes, you can install the package from the local directory.

Clone the repository and checkout the desired branch:

```sh
git clone [email protected]:errorempire/DartHooks.git
```

Add the following to your `pubspec.yaml` file:

```yaml
---
dev_dependencies:
dart_hooks:
path: <some_path>/DartHooks
```
Run the following command to install the package:
```sh
dart pub get
```

## Initialize the Config ⚙️

Execute the following command to create the `dart_hooks.yaml` file:

```sh
dart run dart_hooks:init
dart run dart_hooks init
```

## Applying the Hooks
## Applying the Hooks 🪝

You should modify the list of hooks in the `dart_hooks.yaml` file (i.e., by adding or deleting a hook), you will need to apply the updated hook.

Note that if you are only changing the commands list, executing the following command is not necessary.
Note that if you are only changing the commands list, executing the following command is necessary.

```sh
dart run dart_hooks:apply
dart run dart_hooks apply
```

# Example Config File
## Example Config File 📁

```yaml
---
Expand All @@ -35,20 +70,24 @@ pre-commit:
pre-push:
commands:
- dart analyze
```
OR:
```yaml
---
pre-commit:
commands: dart analyze
commands: [dart analyze]
pre-push:
commands: dart analyze
commands: [dart analyze]
```
# How to Uninstall
## How to Uninstall 🗑️
To remove the hooks and configuration file, execute the command below:
```sh
dart run dart_hooks:destroy
dart run dart_hooks destroy
```

Subsequently, you can remove the dependency by running:
Expand Down
27 changes: 0 additions & 27 deletions lib/checks.dart

This file was deleted.

Loading

0 comments on commit 068eab5

Please sign in to comment.