Skip to content

Commit b6e6c36

Browse files
Merge pull request #6 from dinhquochan/han/v2
[2.x] Switch to use Laravel Pint
2 parents 1a04852 + 336b7f4 commit b6e6c36

21 files changed

Lines changed: 403 additions & 618 deletions

.editorconfig

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
; This file is for unifying the coding style for different editors and IDEs.
2+
; More information at https://editorconfig.org
3+
4+
root = true
5+
6+
[*]
7+
charset = utf-8
8+
indent_size = 4
9+
indent_style = space
10+
end_of_line = lf
11+
insert_final_newline = true
12+
trim_trailing_whitespace = true
13+
14+
[*.md]
15+
trim_trailing_whitespace = false

.gitattributes

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
/.gitattributes export-ignore
2+
/.gitignore export-ignore
3+
/phpunit.xml.dist export-ignore
4+
/tests export-ignore
5+
/.github export-ignore
6+
/.editorconfig export-ignore
7+
/pint.json export-ignore

.styleci.yml

Lines changed: 0 additions & 6 deletions
This file was deleted.

.travis.yml

Lines changed: 0 additions & 20 deletions
This file was deleted.

CHANGELOG.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Changelog
2+
3+
All notable changes to `laravel-twig` will be documented in this file
4+
5+
## 2.0.0 - 2023-01-05
6+
7+
- Drop support PHP 7, Laravel <= 8
8+
- Replace phpcs, php-lint to Laravel Pint
9+
- Rename command `git:install-hooks` to `git-commit-checker:install`
10+
- Rename command `git:pre-commit-hook` to `git-commit-checker:pre-commit-hook`
11+
- Remove command `git:create-phpcs`
12+
- Remove TravisCI, StyleCI, Scrutinizer
13+
- Remove unnecessary files
14+
15+
## 1.0.0
16+
17+
- First release.

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
The MIT License (MIT)
2+
3+
Copyright (c) 2022 Nguyen Minh Sang <sangnguyenplus@gmail.com>
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in
13+
all copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21+
THE SOFTWARE.

README.md

Lines changed: 36 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,50 +1,60 @@
1-
# Laravel GIT commit checker
1+
# Laravel GIT Commit Checker
22

33
[![Latest Version](https://img.shields.io/github/release/botble/git-commit-checker.svg?style=flat-square)](https://github.com/botble/git-commit-checker/releases)
44
[![Software License](https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square)](LICENSE.md)
5-
[![Build Status](https://img.shields.io/travis/botble/git-commit-checker/master.svg?style=flat-square)](https://travis-ci.org/botble/git-commit-checker)
6-
[![Quality Score](https://img.shields.io/scrutinizer/g/botble/git-commit-checker.svg?style=flat-square)](https://scrutinizer-ci.com/g/botble/git-commit-checker)
7-
[![StyleCI](https://github.styleci.io/repos/204389052/shield?branch=master)](https://github.styleci.io/repos/204389052)
85
[![Total Downloads](https://img.shields.io/packagist/dt/botble/git-commit-checker.svg?style=flat-square)](https://packagist.org/packages/botble/git-commit-checker)
96
[![Maintainability](https://api.codeclimate.com/v1/badges/a6e4612307e3b3bf8252/maintainability)](https://codeclimate.com/github/botble/git-commit-checker/maintainability)
107

11-
## Installation
8+
## Requirement
129

13-
```bash
14-
composer require botble/git-commit-checker
15-
```
10+
- Laravel 9.32 or later
11+
- If you're using Laravel 8.0 or earlier, please use version 1.x
1612

17-
For version <= 5.4:
13+
## Installation
1814

19-
Add to section `providers` of `config/app.php`:
15+
You can install the package via composer:
2016

21-
```php
22-
// config/app.php
23-
'providers' => [
24-
...
25-
Botble\GitCommitChecker\Providers\GitCommitCheckerServiceProvider::class,
26-
];
17+
```shell
18+
composer require botble/git-commit-checker
2719
```
2820

2921
Publish the configuration:
3022

3123
```bash
32-
php artisan vendor:publish --provider="Botble\GitCommitChecker\Providers\GitCommitCheckerServiceProvider" --tag=config
24+
php artisan vendor:publish --tag=git-commit-checker-config
3325
```
3426

3527
### Install GIT hooks
36-
```bash
37-
php artisan git:install-hooks
38-
```
3928

40-
- Create default PSR config (It will create phpcs.xml in your root project).
29+
Run this command to install:
4130

42-
```bash
43-
php artisan git:create-phpcs
31+
```shell
32+
php artisan git-commit-checker:install
4433
```
4534

46-
- Run test manually (made sure you've added all changed files to git stage)
35+
Run test manually (made sure you've added all changed files to git stage):
4736

48-
```bash
49-
php artisan git:pre-commit
37+
```shell
38+
php artisan git-commit-checker:pre-commit-hook
5039
```
40+
41+
### Changelog
42+
43+
Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.
44+
45+
## Contributing
46+
47+
Please see [CONTRIBUTING](CONTRIBUTING.md) for details.
48+
49+
### Security
50+
51+
If you discover any security related issues, please email contact@dinhquochan.com instead of using the issue tracker.
52+
53+
## Credits
54+
55+
- [Sang Nguyen](https://github.com/sangnguyenplus)
56+
- [All Contributors](../../contributors)
57+
58+
## License
59+
60+
The MIT License (MIT). Please see [License File](LICENSE) for more information.

composer.json

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,12 @@
2727
}
2828
},
2929
"require": {
30-
"php": "^7.1.3|^8.0|^8.1",
31-
"laravel/framework": "^5.6|^6|^7|^8|^9",
32-
"php-parallel-lint/php-parallel-lint": "^1.0",
33-
"squizlabs/php_codesniffer": "^3.3"
30+
"php": "^8.0|^8.1|^8.2",
31+
"laravel/framework": "^9.32|^10.0",
32+
"laravel/pint": "^1.3.0"
3433
},
3534
"require-dev": {
36-
"phpunit/phpunit": "^6.1|^7.0|^8.0|^9.0"
35+
"phpunit/phpunit": "^9.0"
3736
},
3837
"extra": {
3938
"laravel": {

config/git-commit-checker.php

Lines changed: 34 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,42 @@
11
<?php
22

3-
use Botble\GitCommitChecker\Commands\PreCommitHook;
3+
use Botble\GitCommitChecker\Commands\PreCommitHookCommand;
44

55
return [
66
'enabled' => env('GIT_COMMIT_CHECKER_ENABLED', true),
7-
'psr2' => [
8-
'standard' => __DIR__ . '/../phpcs.xml',
9-
'ignored' => [
10-
'*/database/*',
11-
'*/public/*',
12-
'*/assets/*',
13-
'*/vendor/*',
14-
],
7+
8+
'hooks' => [
9+
'pre-commit' => PreCommitHookCommand::class,
1510
],
16-
'hooks' => [
17-
'pre-commit' => PreCommitHook::class,
11+
12+
'recommended_preset' => [
13+
'preset' => 'psr12',
14+
'rules' => [
15+
'array_syntax' => ['syntax' => 'short'],
16+
'binary_operator_spaces' => [
17+
'default' => 'single_space',
18+
'operators' => [
19+
'=' => null,
20+
],
21+
],
22+
'blank_line_before_statement' => [
23+
'statements' => ['break', 'continue', 'declare', 'return', 'throw', 'try'],
24+
],
25+
'concat_space' => [
26+
'spacing' => 'one',
27+
],
28+
'function_typehint_space' => true,
29+
'native_function_casing' => true,
30+
'no_extra_blank_lines' => true,
31+
'no_leading_namespace_whitespace' => true,
32+
'no_spaces_around_offset' => true,
33+
'no_unused_imports' => true,
34+
'not_operator_with_successor_space' => true,
35+
'object_operator_without_whitespace' => true,
36+
'single_quote' => true,
37+
'trailing_comma_in_multiline' => true,
38+
'unary_operator_spaces' => true,
39+
'whitespace_after_comma_in_array' => true,
40+
],
1841
],
1942
];

phpcs.xml

Lines changed: 0 additions & 52 deletions
This file was deleted.

0 commit comments

Comments
 (0)