Skip to content

Commit a51a371

Browse files
authored
Merge pull request #80 from Art4/79-reuse-tool-and-spdx-copyright-comments
Use reuse tool for spdx copyright comments
2 parents f5cc92c + 26db8da commit a51a371

File tree

93 files changed

+640
-1366
lines changed

Some content is hidden

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

93 files changed

+640
-1366
lines changed

.docker/Dockerfile-php82

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ RUN apt-get --yes --no-install-recommends install \
88
vim \
99
curl \
1010
build-essential \
11+
pipx \
1112
locales \
1213
zip unzip \
1314
libfreetype6-dev \

.gitattributes

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# SPDX-FileCopyrightText: 2015-2023 Artur Weigandt https://wlabs.de/kontakt
2+
# SPDX-License-Identifier: GPL-3.0-or-later
3+
14
/.docker export-ignore
25
/.gitattributes export-ignore
36
/.gitignore export-ignore

.gitignore

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
.idea
22
.php-cs-fixer.cache
33
.phpunit.cache
4-
composer.phar
54
composer.lock
6-
php-cs-fixer.phar
75
vendor

.php-cs-fixer.dist.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
<?php
22

3+
// SPDX-FileCopyrightText: 2015-2023 Artur Weigandt https://wlabs.de/kontakt
4+
//
5+
// SPDX-License-Identifier: GPL-3.0-or-later
6+
37
$finder = (new PhpCsFixer\Finder())
48
->in('src')
59
->in('tests')

.phpstan.neon

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# SPDX-FileCopyrightText: 2015-2023 Artur Weigandt https://wlabs.de/kontakt
2+
# SPDX-License-Identifier: GPL-3.0-or-later
3+
14
parameters:
25
level: 8
36

.reuse/dep5

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
2+
Upstream-Name: art4/json-api-client
3+
Upstream-Contact: Artur Weigandt <art4@wlabs.de>
4+
Source: https://github.com/Art4/json-api-client
5+
6+
# Sample paragraph, commented out:
7+
#
8+
# Files: src/*
9+
# Copyright: $YEAR $NAME <$CONTACT>
10+
# License: ...
11+
12+
Files: .docker/*
13+
Copyright: 2015-2023 Artur Weigandt https://wlabs.de/kontakt
14+
License: GPL-3.0-or-later
15+
16+
Files: .github/*
17+
Copyright: 2015-2023 Artur Weigandt https://wlabs.de/kontakt
18+
License: GPL-3.0-or-later
19+
20+
Files: .gitignore
21+
Copyright: 2015-2023 Artur Weigandt https://wlabs.de/kontakt
22+
License: GPL-3.0-or-later
23+
24+
Files: CHANGELOG.md
25+
Copyright: 2015-2023 Artur Weigandt https://wlabs.de/kontakt
26+
License: GPL-3.0-or-later
27+
28+
Files: composer.json
29+
Copyright: 2015-2023 Artur Weigandt https://wlabs.de/kontakt
30+
License: GPL-3.0-or-later
31+
32+
Files: composer.lock
33+
Copyright: 2015-2023 Artur Weigandt https://wlabs.de/kontakt
34+
License: GPL-3.0-or-later
35+
36+
Files: docs/*
37+
Copyright: 2015-2023 Artur Weigandt https://wlabs.de/kontakt
38+
License: GPL-3.0-or-later
39+
40+
Files: phpunit.xml
41+
Copyright: 2015-2023 Artur Weigandt https://wlabs.de/kontakt
42+
License: GPL-3.0-or-later
43+
44+
Files: README.md
45+
Copyright: 2015-2023 Artur Weigandt https://wlabs.de/kontakt
46+
License: GPL-3.0-or-later
47+
48+
Files: tests/files/*
49+
Copyright: 2015-2023 Artur Weigandt https://wlabs.de/kontakt
50+
License: GPL-3.0-or-later
51+
52+
# Ignore following folders
53+
# for some reason reuse does not ignore files defined in .gitignore
54+
55+
Files: .phpunit.cache/*
56+
Copyright: 2015-2023 Artur Weigandt https://wlabs.de/kontakt
57+
License: GPL-3.0-or-later
58+
59+
Files: .php-cs-fixer.cache
60+
Copyright: 2015-2023 Artur Weigandt https://wlabs.de/kontakt
61+
License: GPL-3.0-or-later
62+
63+
Files: vendor/*
64+
Copyright: 2015-2023 Artur Weigandt https://wlabs.de/kontakt
65+
License: GPL-3.0-or-later

LICENSES/GPL-3.0-or-later.txt

Lines changed: 232 additions & 0 deletions
Large diffs are not rendered by default.

README.md

Lines changed: 46 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -115,15 +115,57 @@ Need more functionality? Want to directly inject your model? Easily extend JsonA
115115

116116
Please see [CHANGELOG](CHANGELOG.md) for more information what has changed recently.
117117

118-
## :white_check_mark: Testing
118+
## :wrench: Contributing
119+
120+
Please feel free to fork and sending Pull Requests. This project follows [Semantic Versioning 2](http://semver.org) and [PSR-2](http://www.php-fig.org/psr/psr-2/).
121+
122+
This projects comes with a `docker-compose.yml` where all tools for development are available.
123+
124+
Run `docker compose build` to build the image. Once you've build it, run `docker compose up -d` to start the container in the background.
125+
126+
Run `docker compose exec -u 1000 php bash` to use the bash inside the running container. There you can use all tools, e.g. composer with `composer --version`
127+
128+
Use `exit` to logout from the container and `docker compose stop` to stop the running container.
129+
130+
All following commands can be run inside the running docker container.
131+
132+
### :white_check_mark: Testing
133+
134+
Run PHPUnit for all tests:
119135

120136
``` bash
121-
$ phpunit
137+
$ composer run phpunit
122138
```
123139

124-
## :wrench: Contributing
140+
Run PHPStan for static code analysis:
125141

126-
Please feel free to fork and sending Pull Requests. This project follows [Semantic Versioning 2](http://semver.org) and [PSR-2](http://www.php-fig.org/psr/psr-2/).
142+
``` bash
143+
$ composer run phpstan
144+
```
145+
146+
Let PHPUnit generate a HTLM code coverage report:
147+
148+
``` bash
149+
$ composer run coverage
150+
```
151+
152+
You can find the code coverage report in `.phpunit.cache/code-coverage/index.html`.
153+
154+
### :white_check_mark: REUSE
155+
156+
The [REUSE Helper tool](https://reuse.software/dev/) makes licensing easy for humans and machines alike. It downloads the full license texts, adds copyright and license information to file headers, and contains a linter to identify problems.
157+
158+
Check all files for REUSE spec compliance:
159+
160+
``` bash
161+
composer run reuse-lint
162+
```
163+
164+
Run this command to annotate PHP files in src and tests folders:
165+
166+
``` bash
167+
composer run reuse-annotate
168+
```
127169

128170
## :heart: Credits
129171

composer.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,9 @@
3333
"scripts": {
3434
"coverage": "phpunit --coverage-html=\".phpunit.cache/code-coverage\"",
3535
"phpstan": "phpstan analyze --memory-limit 512M --configuration .phpstan.neon",
36-
"phpunit": "phpunit"
36+
"phpunit": "phpunit",
37+
"reuse-annotate": "pipx run reuse annotate src tests --license=\"GPL-3.0-or-later\" --copyright=\"2015-2023 Artur Weigandt https://wlabs.de/kontakt\" --recursive --exclude-year --copyright-style=\"spdx\"",
38+
"reuse-lint": "pipx run reuse --suppress-deprecation lint"
3739
},
3840
"config": {
3941
"sort-packages": true

docker-compose.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# SPDX-FileCopyrightText: 2015-2023 Artur Weigandt https://wlabs.de/kontakt
2+
# SPDX-License-Identifier: GPL-3.0-or-later
3+
14
version: "3.7"
25

36
services:

0 commit comments

Comments
 (0)