Skip to content
This repository was archived by the owner on Jun 3, 2020. It is now read-only.

Commit 689cf0a

Browse files
committed
Initial Commit
0 parents  commit 689cf0a

File tree

62 files changed

+3127
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

62 files changed

+3127
-0
lines changed

.editorconfig

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# EditorConfig is awesome: http://EditorConfig.org
2+
3+
root = true
4+
5+
[*]
6+
indent_style = space
7+
end_of_line = lf
8+
charset = utf-8
9+
trim_trailing_whitespace = true
10+
insert_final_newline = true
11+
12+
[*.yml]
13+
indent_size = 2
14+
15+
[*.php]
16+
indent_size = 4

.gitignore

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
/vendor/
2+
/composer.phar
3+
/composer.lock
4+
/.idea
5+
/bin/
6+
7+
8+
### OSX template
9+
*.DS_Store
10+
.AppleDouble
11+
.LSOverride
12+
13+
# Icon must end with two \r
14+
Icon
15+
16+
# Thumbnails
17+
._*
18+
19+
# Files that might appear in the root of a volume
20+
.DocumentRevisions-V100
21+
.fseventsd
22+
.Spotlight-V100
23+
.TemporaryItems
24+
.Trashes
25+
.VolumeIcon.icns
26+
.com.apple.timemachine.donotpresent
27+
28+
# Directories potentially created on remote AFP share
29+
.AppleDB
30+
.AppleDesktop
31+
Network Trash Folder
32+
Temporary Items
33+
.apdisk
34+
### Windows template
35+
# Windows image file caches
36+
Thumbs.db
37+
ehthumbs.db
38+
39+
# Folder config file
40+
Desktop.ini
41+
42+
# Recycle Bin used on file shares
43+
$RECYCLE.BIN/
44+
45+
# Windows Installer files
46+
*.cab
47+
*.msi
48+
*.msm
49+
*.msp
50+
51+
# Windows shortcuts
52+
*.lnk
53+
### Linux template
54+
*~
55+
56+
# temporary files which can be created if a process still has a handle open of a deleted file
57+
.fuse_hidden*
58+
59+
# KDE directory preferences
60+
.directory
61+
62+
# Linux trash folder which might appear on any partition or disk
63+
.Trash-*

.scrutinizer.yml

Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
checks:
2+
php:
3+
use_self_instead_of_fqcn: true
4+
uppercase_constants: true
5+
simplify_boolean_return: true
6+
return_doc_comments: true
7+
return_doc_comment_if_not_inferrable: true
8+
properties_in_camelcaps: true
9+
prefer_while_loop_over_for_loop: true
10+
phpunit_assertions: true
11+
parameters_in_camelcaps: true
12+
parameter_doc_comments: true
13+
param_doc_comment_if_not_inferrable: true
14+
optional_parameters_at_the_end: true
15+
no_short_variable_names:
16+
minimum: '3'
17+
no_short_method_names:
18+
minimum: '3'
19+
no_long_variable_names:
20+
maximum: '20'
21+
no_goto: true
22+
newline_at_end_of_file: true
23+
naming_conventions:
24+
local_variable: '^[a-z][a-zA-Z0-9]*$'
25+
abstract_class_name: ^Abstract|Factory$
26+
utility_class_name: 'Utils?$'
27+
constant_name: '^[A-Z][A-Z0-9]*(?:_[A-Z0-9]+)*$'
28+
property_name: '^[a-z][a-zA-Z0-9]*$'
29+
method_name: '^(?:[a-z]|__)[a-zA-Z0-9]*$'
30+
parameter_name: '^[a-z][a-zA-Z0-9]*$'
31+
interface_name: '^[A-Z][a-zA-Z0-9]*$'
32+
type_name: '^[A-Z][a-zA-Z0-9]*$'
33+
exception_name: '^[A-Z][a-zA-Z0-9]*Exception$'
34+
isser_method_name: '^(?:is|has|should|may|supports)'
35+
more_specific_types_in_doc_comments: true
36+
line_length:
37+
max_length: '120'
38+
function_in_camel_caps: true
39+
fix_use_statements:
40+
remove_unused: true
41+
preserve_multiple: false
42+
preserve_blanklines: false
43+
order_alphabetically: true
44+
fix_line_ending: true
45+
classes_in_camel_caps: true
46+
check_method_contracts:
47+
verify_interface_like_constraints: true
48+
verify_documented_constraints: true
49+
verify_parent_constraints: true
50+
avoid_unnecessary_concatenation: true
51+
avoid_todo_comments: true
52+
avoid_perl_style_comments: true
53+
avoid_multiple_statements_on_same_line: true
54+
avoid_fixme_comments: true
55+
align_assignments: true
56+
code_rating: true
57+
duplication: true
58+
59+
filter:
60+
excluded_paths:
61+
- vendor/*
62+
- spec/*
63+
coding_style:
64+
php:
65+
spaces:
66+
around_operators:
67+
concatenation: true
68+
braces:
69+
classes_functions:
70+
class: new-line
71+
function: new-line
72+
closure: end-of-line
73+
if:
74+
opening: end-of-line
75+
for:
76+
opening: end-of-line
77+
while:
78+
opening: end-of-line
79+
do_while:
80+
opening: end-of-line
81+
switch:
82+
opening: end-of-line
83+
try:
84+
opening: end-of-line
85+
upper_lower_casing:
86+
keywords:
87+
general: lower
88+
constants:
89+
true_false_null: lower
90+
91+
build:
92+
environment:
93+
php:
94+
version: 7.0.8
95+
tests:
96+
override:
97+
-
98+
command: 'vendor/bin/phpspec run'

.travis.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
language: php
2+
3+
php:
4+
- '7.0'
5+
- nightly
6+
7+
before_script:
8+
- composer install
9+
10+
script:
11+
- vendor/bin/phpspec run

CONTRIBUTING.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# Contributing
2+
3+
We welcome all contributions, however here are some guidelines:
4+
5+
* For large changes please discuss them in an issue first
6+
* Use feature branches for your changes
7+
* Ensure the commits you're submitting are tidy, and reasonable (rebase if necessary)
8+
* Please ensure scrutinizer isn't reporting any new issues
9+
* You have added new tests for new functionality if you are adding it.
10+
* You are following our [code of conduct][coc]
11+
12+
[coc]: code_of_conduct.md

LICENSE.md

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

README.md

Lines changed: 121 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,121 @@
1+
# Git GitHub Lint
2+
3+
[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/PurpleBooth/git-github-lint/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/PurpleBooth/git-github-lint/?branch=master)
4+
[![Build Status](https://travis-ci.org/PurpleBooth/git-github-lint.svg?branch=master)](https://travis-ci.org/PurpleBooth/git-github-lint)
5+
[![Dependency Status](https://www.versioneye.com/user/projects/579afcf63815c8005161534d/badge.svg?style=flat-square)](https://www.versioneye.com/user/projects/579afcf63815c8005161534d)
6+
[![Latest Stable Version](https://poser.pugx.org/purplebooth/git-github-lint/v/stable)](https://packagist.org/packages/purplebooth/git-github-lint)
7+
[![License](https://poser.pugx.org/purplebooth/git-github-lint/license)](https://packagist.org/packages/purplebooth/git-github-lint)
8+
9+
This project is designed to ensure that the commits you're making to a
10+
repository follow the git coding style. This is the library component
11+
with no web frontend.
12+
13+
## Getting Started
14+
15+
### Prerequisities
16+
17+
You'll need to install:
18+
19+
* PHP (Minimum 7.0)
20+
21+
### Installing
22+
23+
```
24+
composer require PurpleBooth/git-github-lint
25+
```
26+
27+
## Usage
28+
29+
You can use the whole library
30+
31+
```php
32+
<?php
33+
34+
$gitHubClient = new \Github\Client()
35+
36+
/** @var GitHubLint $gitHubLint **/
37+
$gitHubLint = new GitHubLintImplementation($gitHubClient);
38+
$gitHubLint->analyse('PurpleBooth', 'git-github-lint', 1);
39+
// -> The commits on your PR should now be updated with a status
40+
```
41+
42+
Alternatively you could use the validators alone
43+
44+
```php
45+
<?php
46+
47+
$messageValidator new ValidateMessagesImplementation(
48+
new ValidateMessageImplementation(
49+
[
50+
new CapitalizeTheSubjectLineValidator(),
51+
new DoNotEndTheSubjectLineWithAPeriodValidator(),
52+
new LimitTheBodyWrapLengthTo72CharactersValidator(),
53+
new LimitTheTitleLengthTo69CharactersValidator(),
54+
new SeparateSubjectFromBodyWithABlankLineValidator(),
55+
new SoftLimitTheTitleLengthTo50CharactersValidator(),
56+
]
57+
)
58+
);
59+
60+
61+
$message
62+
= <<<MESSAGE
63+
This is an example title
64+
65+
This is a message body. This is another part of the body.
66+
MESSAGE;
67+
68+
$exampleMessage = new MessageImplementation("exampleSha", $message);
69+
70+
$messageValidator->validate([$exampleMessage]);
71+
// -> Message Objects will now have a Status set on them
72+
```
73+
74+
Please depend on the interfaces rather than the concrete
75+
implementations. Concrete implementations may change without causing a
76+
BC break, interfaces changing will cause major version increment,
77+
indicating a BC break.
78+
79+
## Running the tests
80+
81+
To run the tests for coding style
82+
83+
First checkout the library, then run
84+
85+
```
86+
composer install
87+
```
88+
89+
### Coding Style
90+
91+
We follow PSR2, and also enforce PHPDocs on all functions
92+
93+
```
94+
vendor/bin/phpcs -p --standard=psr2 src/ spec/
95+
```
96+
97+
### Unit tests
98+
99+
We use PHPSpec for unit tests
100+
101+
```
102+
vendor/bin/phpspec run
103+
```
104+
105+
## Contributing
106+
107+
Please read [CONTRIBUTING.md](CONTRIBUTING.md) for details on our code
108+
of conduct, and the process for submitting pull requests to us.
109+
110+
## Versioning
111+
112+
We use [SemVer](http://semver.org/) for versioning. For the versions
113+
available, see the [tags on this repository](https://github.com/purplebooth/git-github-lint/tags).
114+
115+
## Authors
116+
117+
See the list of [contributors](https://github.com/purplebooth/git-github-lint/contributors) who participated in this project.
118+
119+
## License
120+
121+
This project is licensed under the MIT License - see the [LICENSE.md](LICENSE.md) file for details

0 commit comments

Comments
 (0)