Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use reuse tool for spdx copyright comments #80

Merged
merged 5 commits into from
Oct 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .docker/Dockerfile-php82
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ RUN apt-get --yes --no-install-recommends install \
vim \
curl \
build-essential \
pipx \
locales \
zip unzip \
libfreetype6-dev \
Expand Down
3 changes: 3 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# SPDX-FileCopyrightText: 2015-2023 Artur Weigandt https://wlabs.de/kontakt
# SPDX-License-Identifier: GPL-3.0-or-later

/.docker export-ignore
/.gitattributes export-ignore
/.gitignore export-ignore
Expand Down
2 changes: 0 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
.idea
.php-cs-fixer.cache
.phpunit.cache
composer.phar
composer.lock
php-cs-fixer.phar
vendor
4 changes: 4 additions & 0 deletions .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
<?php

// SPDX-FileCopyrightText: 2015-2023 Artur Weigandt https://wlabs.de/kontakt
//
// SPDX-License-Identifier: GPL-3.0-or-later

$finder = (new PhpCsFixer\Finder())
->in('src')
->in('tests')
Expand Down
3 changes: 3 additions & 0 deletions .phpstan.neon
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# SPDX-FileCopyrightText: 2015-2023 Artur Weigandt https://wlabs.de/kontakt
# SPDX-License-Identifier: GPL-3.0-or-later

parameters:
level: 8

Expand Down
65 changes: 65 additions & 0 deletions .reuse/dep5
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Upstream-Name: art4/json-api-client
Upstream-Contact: Artur Weigandt <[email protected]>
Source: https://github.com/Art4/json-api-client

# Sample paragraph, commented out:
#
# Files: src/*
# Copyright: $YEAR $NAME <$CONTACT>
# License: ...

Files: .docker/*
Copyright: 2015-2023 Artur Weigandt https://wlabs.de/kontakt
License: GPL-3.0-or-later

Files: .github/*
Copyright: 2015-2023 Artur Weigandt https://wlabs.de/kontakt
License: GPL-3.0-or-later

Files: .gitignore
Copyright: 2015-2023 Artur Weigandt https://wlabs.de/kontakt
License: GPL-3.0-or-later

Files: CHANGELOG.md
Copyright: 2015-2023 Artur Weigandt https://wlabs.de/kontakt
License: GPL-3.0-or-later

Files: composer.json
Copyright: 2015-2023 Artur Weigandt https://wlabs.de/kontakt
License: GPL-3.0-or-later

Files: composer.lock
Copyright: 2015-2023 Artur Weigandt https://wlabs.de/kontakt
License: GPL-3.0-or-later

Files: docs/*
Copyright: 2015-2023 Artur Weigandt https://wlabs.de/kontakt
License: GPL-3.0-or-later

Files: phpunit.xml
Copyright: 2015-2023 Artur Weigandt https://wlabs.de/kontakt
License: GPL-3.0-or-later

Files: README.md
Copyright: 2015-2023 Artur Weigandt https://wlabs.de/kontakt
License: GPL-3.0-or-later

Files: tests/files/*
Copyright: 2015-2023 Artur Weigandt https://wlabs.de/kontakt
License: GPL-3.0-or-later

# Ignore following folders
# for some reason reuse does not ignore files defined in .gitignore

Files: .phpunit.cache/*
Copyright: 2015-2023 Artur Weigandt https://wlabs.de/kontakt
License: GPL-3.0-or-later

Files: .php-cs-fixer.cache
Copyright: 2015-2023 Artur Weigandt https://wlabs.de/kontakt
License: GPL-3.0-or-later

Files: vendor/*
Copyright: 2015-2023 Artur Weigandt https://wlabs.de/kontakt
License: GPL-3.0-or-later
232 changes: 232 additions & 0 deletions LICENSES/GPL-3.0-or-later.txt

Large diffs are not rendered by default.

50 changes: 46 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -115,15 +115,57 @@ Need more functionality? Want to directly inject your model? Easily extend JsonA

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

## :white_check_mark: Testing
## :wrench: Contributing

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/).

This projects comes with a `docker-compose.yml` where all tools for development are available.

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.

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`

Use `exit` to logout from the container and `docker compose stop` to stop the running container.

All following commands can be run inside the running docker container.

### :white_check_mark: Testing

Run PHPUnit for all tests:

``` bash
$ phpunit
$ composer run phpunit
```

## :wrench: Contributing
Run PHPStan for static code analysis:

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/).
``` bash
$ composer run phpstan
```

Let PHPUnit generate a HTLM code coverage report:

``` bash
$ composer run coverage
```

You can find the code coverage report in `.phpunit.cache/code-coverage/index.html`.

### :white_check_mark: REUSE

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.

Check all files for REUSE spec compliance:

``` bash
composer run reuse-lint
```

Run this command to annotate PHP files in src and tests folders:

``` bash
composer run reuse-annotate
```

## :heart: Credits

Expand Down
4 changes: 3 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,9 @@
"scripts": {
"coverage": "phpunit --coverage-html=\".phpunit.cache/code-coverage\"",
"phpstan": "phpstan analyze --memory-limit 512M --configuration .phpstan.neon",
"phpunit": "phpunit"
"phpunit": "phpunit",
"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\"",
"reuse-lint": "pipx run reuse --suppress-deprecation lint"
},
"config": {
"sort-packages": true
Expand Down
3 changes: 3 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# SPDX-FileCopyrightText: 2015-2023 Artur Weigandt https://wlabs.de/kontakt
# SPDX-License-Identifier: GPL-3.0-or-later

version: "3.7"

services:
Expand Down
19 changes: 3 additions & 16 deletions src/Accessable.php
Original file line number Diff line number Diff line change
@@ -1,21 +1,8 @@
<?php
/*
* A PHP Library to handle a JSON API body in an OOP way.
* Copyright (C) 2015-2021 Artur Weigandt https://wlabs.de/kontakt

* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
// SPDX-FileCopyrightText: 2015-2023 Artur Weigandt https://wlabs.de/kontakt
//
// SPDX-License-Identifier: GPL-3.0-or-later

namespace Art4\JsonApiClient;

Expand Down
19 changes: 3 additions & 16 deletions src/Element.php
Original file line number Diff line number Diff line change
@@ -1,21 +1,8 @@
<?php
/*
* A PHP Library to handle a JSON API body in an OOP way.
* Copyright (C) 2015-2021 Artur Weigandt https://wlabs.de/kontakt

* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
// SPDX-FileCopyrightText: 2015-2023 Artur Weigandt https://wlabs.de/kontakt
//
// SPDX-License-Identifier: GPL-3.0-or-later

namespace Art4\JsonApiClient;

Expand Down
19 changes: 3 additions & 16 deletions src/Exception/AccessException.php
Original file line number Diff line number Diff line change
@@ -1,21 +1,8 @@
<?php
/*
* A PHP Library to handle a JSON API body in an OOP way.
* Copyright (C) 2015-2021 Artur Weigandt https://wlabs.de/kontakt

* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
// SPDX-FileCopyrightText: 2015-2023 Artur Weigandt https://wlabs.de/kontakt
//
// SPDX-License-Identifier: GPL-3.0-or-later

namespace Art4\JsonApiClient\Exception;

Expand Down
19 changes: 3 additions & 16 deletions src/Exception/Exception.php
Original file line number Diff line number Diff line change
@@ -1,21 +1,8 @@
<?php
/*
* A PHP Library to handle a JSON API body in an OOP way.
* Copyright (C) 2015-2021 Artur Weigandt https://wlabs.de/kontakt

* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
// SPDX-FileCopyrightText: 2015-2023 Artur Weigandt https://wlabs.de/kontakt
//
// SPDX-License-Identifier: GPL-3.0-or-later

namespace Art4\JsonApiClient\Exception;

Expand Down
19 changes: 3 additions & 16 deletions src/Exception/FactoryException.php
Original file line number Diff line number Diff line change
@@ -1,21 +1,8 @@
<?php
/*
* A PHP Library to handle a JSON API body in an OOP way.
* Copyright (C) 2015-2021 Artur Weigandt https://wlabs.de/kontakt

* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
// SPDX-FileCopyrightText: 2015-2023 Artur Weigandt https://wlabs.de/kontakt
//
// SPDX-License-Identifier: GPL-3.0-or-later

namespace Art4\JsonApiClient\Exception;

Expand Down
19 changes: 3 additions & 16 deletions src/Exception/InputException.php
Original file line number Diff line number Diff line change
@@ -1,21 +1,8 @@
<?php
/*
* A PHP Library to handle a JSON API body in an OOP way.
* Copyright (C) 2015-2021 Artur Weigandt https://wlabs.de/kontakt

* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
// SPDX-FileCopyrightText: 2015-2023 Artur Weigandt https://wlabs.de/kontakt
//
// SPDX-License-Identifier: GPL-3.0-or-later

namespace Art4\JsonApiClient\Exception;

Expand Down
19 changes: 3 additions & 16 deletions src/Exception/ValidationException.php
Original file line number Diff line number Diff line change
@@ -1,21 +1,8 @@
<?php
/*
* A PHP Library to handle a JSON API body in an OOP way.
* Copyright (C) 2015-2021 Artur Weigandt https://wlabs.de/kontakt

* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
// SPDX-FileCopyrightText: 2015-2023 Artur Weigandt https://wlabs.de/kontakt
//
// SPDX-License-Identifier: GPL-3.0-or-later

namespace Art4\JsonApiClient\Exception;

Expand Down
19 changes: 3 additions & 16 deletions src/Factory.php
Original file line number Diff line number Diff line change
@@ -1,21 +1,8 @@
<?php
/*
* A PHP Library to handle a JSON API body in an OOP way.
* Copyright (C) 2015-2021 Artur Weigandt https://wlabs.de/kontakt

* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
// SPDX-FileCopyrightText: 2015-2023 Artur Weigandt https://wlabs.de/kontakt
//
// SPDX-License-Identifier: GPL-3.0-or-later

namespace Art4\JsonApiClient;

Expand Down
Loading