From 5490b114faeec599bdf843b1cb6d901934bb1121 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20Fr=C3=B6mer?= Date: Tue, 4 Jan 2022 15:54:58 +0100 Subject: [PATCH 1/3] Initial commit --- .github/FUNDING.yml | 3 + .github/PULL_REQUEST_TEMPLATE.md | 17 ++++++ .github/dependabot.yaml | 27 +++++++++ .github/workflows/validate-code.yml | 85 +++++++++++++++++++++++++++++ CHANGELOG.md | 9 +++ CODE_OF_CONDUCT.md | 46 ++++++++++++++++ CONTRIBUTING.md | 16 ++++++ README.md | 2 +- composer.json | 20 +++++++ src/LinkInterface.php | 10 ++++ src/PackageInterface.php | 25 +++++++++ src/RepositoryInterface.php | 10 ++++ 12 files changed, 269 insertions(+), 1 deletion(-) create mode 100644 .github/FUNDING.yml create mode 100644 .github/PULL_REQUEST_TEMPLATE.md create mode 100644 .github/dependabot.yaml create mode 100644 .github/workflows/validate-code.yml create mode 100644 CHANGELOG.md create mode 100644 CODE_OF_CONDUCT.md create mode 100644 CONTRIBUTING.md create mode 100644 composer.json create mode 100644 src/LinkInterface.php create mode 100644 src/PackageInterface.php create mode 100644 src/RepositoryInterface.php diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml new file mode 100644 index 0000000..6079c00 --- /dev/null +++ b/.github/FUNDING.yml @@ -0,0 +1,3 @@ +custom: + - "https://paypal.me/icanhazstring" +github: "icanhazstring" diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000..aa026af --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,17 @@ +### All Submissions: + +* [ ] Have you followed the guidelines in our [Contributing document](https://github.com/composer-unused/composer-unused/blob/main/CONTRIBUTING.md)? +* [ ] Have you checked to ensure there aren't other open [Pull Requests](https://github.com/icanhazstring/composer-unused/pulls) for the same update/change? + + + +### New Feature Submissions: + +1. [ ] Does your submission pass tests? +2. [ ] Have you lint your code locally prior to submission? + +### Changes to Core Features: + +* [ ] Have you added an explanation of what your changes do and why you'd like us to include them? +* [ ] Have you written new tests for your core changes, as applicable? +* [ ] Have you successfully ran tests with your changes locally? diff --git a/.github/dependabot.yaml b/.github/dependabot.yaml new file mode 100644 index 0000000..eb22ef0 --- /dev/null +++ b/.github/dependabot.yaml @@ -0,0 +1,27 @@ +# https://docs.github.com/en/github/administering-a-repository/configuration-options-for-dependency-updates + +version: 2 + +updates: + - commit-message: + include: "scope" + prefix: "composer" + directory: "/" + labels: + - "dependency" + open-pull-requests-limit: 10 + package-ecosystem: "composer" + schedule: + interval: "daily" + versioning-strategy: "increase" + + - commit-message: + include: "scope" + prefix: "github-actions" + directory: "/" + labels: + - "dependency" + open-pull-requests-limit: 10 + package-ecosystem: "github-actions" + schedule: + interval: "daily" diff --git a/.github/workflows/validate-code.yml b/.github/workflows/validate-code.yml new file mode 100644 index 0000000..f645787 --- /dev/null +++ b/.github/workflows/validate-code.yml @@ -0,0 +1,85 @@ +name: CI Pipeline +on: + push: + branches: + - "[0-9]+.[0-9]+.x" + pull_request: + +jobs: + coding-standard: + name: "Coding Standard" + runs-on: "${{ matrix.os }}" + strategy: + fail-fast: true + matrix: + os: [ "ubuntu-latest" ] + php: [ "8.0" ] + steps: + - name: Checkout + uses: actions/checkout@v2.4.0 + + - name: Setup PHP + uses: shivammathur/setup-php@2.16.0 + with: + php-version: ${{ matrix.php }} + tools: composer:v2, pecl + extensions: ds + + - name: Install dependencies + run: composer install --no-progress --prefer-dist --optimize-autoloader + + - name: Check codestyle + run: vendor/bin/phpcs -s + + static-analysis: + name: "Static Analysis" + runs-on: "${{ matrix.os }}" + strategy: + fail-fast: true + matrix: + php: [ "8.0" ] + os: [ "ubuntu-latest" ] + steps: + - name: Checkout + uses: actions/checkout@v2.4.0 + + - name: Setup PHP + uses: shivammathur/setup-php@2.16.0 + with: + php-version: ${{ matrix.php }} + tools: composer:v2, pecl + extensions: ds + + - name: Install dependencies + run: composer install --no-progress --prefer-dist --optimize-autoloader + + - name: Analyze code with static-analysis + run: vendor/bin/phpstan analyse --no-progress + + unit-tests: + name: "Unit Tests" + runs-on: "${{ matrix.os }}" + continue-on-error: "${{ matrix.experimental }}" + strategy: + fail-fast: false + matrix: + php: [ "7.4", "8.0", "8.1" ] + os: [ "ubuntu-latest" ] + experimental: [ false ] + + steps: + - name: Checkout + uses: actions/checkout@v2.4.0 + + - name: Setup PHP + uses: shivammathur/setup-php@2.16.0 + with: + php-version: ${{ matrix.php }} + tools: composer:v2, pecl + extensions: ds + + - name: Install dependencies + run: composer install --no-progress --prefer-dist --optimize-autoloader ${{ matrix.composer-options }} + + - name: Execute tests + run: vendor/bin/phpunit --colors=always --coverage-text diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..8baf51c --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,9 @@ +# Changelog + +## [Unreleased] - TBA +### Added +- Added `LinkInterface` +- Added `PackageInterface` +- Added `RepositoryInterface` +### Changed +### Removed diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md new file mode 100644 index 0000000..fe79b78 --- /dev/null +++ b/CODE_OF_CONDUCT.md @@ -0,0 +1,46 @@ +# Contributor Covenant Code of Conduct + +## Our Pledge + +In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation. + +## Our Standards + +Examples of behavior that contributes to creating a positive environment include: + +* Using welcoming and inclusive language +* Being respectful of differing viewpoints and experiences +* Gracefully accepting constructive criticism +* Focusing on what is best for the community +* Showing empathy towards other community members + +Examples of unacceptable behavior by participants include: + +* The use of sexualized language or imagery and unwelcome sexual attention or advances +* Trolling, insulting/derogatory comments, and personal or political attacks +* Public or private harassment +* Publishing others' private information, such as a physical or electronic address, without explicit permission +* Other conduct which could reasonably be considered inappropriate in a professional setting + +## Our Responsibilities + +Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior. + +Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful. + +## Scope + +This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers. + +## Enforcement + +Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at blubb0r05+github@gmail.com. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately. + +Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership. + +## Attribution + +This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version] + +[homepage]: http://contributor-covenant.org +[version]: http://contributor-covenant.org/version/1/4/ diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..7fe22bd --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,16 @@ +# CONTRIBUTING + +Thank you for considering contributing to this package! + +## Steps to contribute + +### Installation + +1. Fork the repository +2. `git clone yourname/contracts` +5. Run `composer install` + +### Submitting Changes + +6. Make your changes +8. Create your Pull-Request diff --git a/README.md b/README.md index b26a586..528bd64 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,2 @@ -# contracts +# composer-unused/contracts Contract repository for composer-unused diff --git a/composer.json b/composer.json new file mode 100644 index 0000000..4b5265d --- /dev/null +++ b/composer.json @@ -0,0 +1,20 @@ +{ + "name": "composer-unused/contracts", + "description": "Contract repository for composer-unused", + "type": "library", + "license": "MIT", + "autoload": { + "psr-4": { + "ComposerUnused\\Contracts\\": "src/" + } + }, + "authors": [ + { + "name": "Andreas Frömer", + "email": "composer-unused@icanhazstring.com" + } + ], + "require": { + "php": "^7.4 || ^8.0" + } +} diff --git a/src/LinkInterface.php b/src/LinkInterface.php new file mode 100644 index 0000000..0c2d337 --- /dev/null +++ b/src/LinkInterface.php @@ -0,0 +1,10 @@ +, psr-4?: array, classmap?: list, files?: list} + */ + public function getAutoload(): array; + + public function getName(): string; + + /** + * @return array + */ + public function getRequires(): array; + + /** + * @return array + */ + public function getSuggests(): array; +} diff --git a/src/RepositoryInterface.php b/src/RepositoryInterface.php new file mode 100644 index 0000000..af20760 --- /dev/null +++ b/src/RepositoryInterface.php @@ -0,0 +1,10 @@ + Date: Tue, 4 Jan 2022 15:56:45 +0100 Subject: [PATCH 2/3] Drop action workflow for now --- .github/workflows/validate-code.yml | 85 ----------------------------- 1 file changed, 85 deletions(-) delete mode 100644 .github/workflows/validate-code.yml diff --git a/.github/workflows/validate-code.yml b/.github/workflows/validate-code.yml deleted file mode 100644 index f645787..0000000 --- a/.github/workflows/validate-code.yml +++ /dev/null @@ -1,85 +0,0 @@ -name: CI Pipeline -on: - push: - branches: - - "[0-9]+.[0-9]+.x" - pull_request: - -jobs: - coding-standard: - name: "Coding Standard" - runs-on: "${{ matrix.os }}" - strategy: - fail-fast: true - matrix: - os: [ "ubuntu-latest" ] - php: [ "8.0" ] - steps: - - name: Checkout - uses: actions/checkout@v2.4.0 - - - name: Setup PHP - uses: shivammathur/setup-php@2.16.0 - with: - php-version: ${{ matrix.php }} - tools: composer:v2, pecl - extensions: ds - - - name: Install dependencies - run: composer install --no-progress --prefer-dist --optimize-autoloader - - - name: Check codestyle - run: vendor/bin/phpcs -s - - static-analysis: - name: "Static Analysis" - runs-on: "${{ matrix.os }}" - strategy: - fail-fast: true - matrix: - php: [ "8.0" ] - os: [ "ubuntu-latest" ] - steps: - - name: Checkout - uses: actions/checkout@v2.4.0 - - - name: Setup PHP - uses: shivammathur/setup-php@2.16.0 - with: - php-version: ${{ matrix.php }} - tools: composer:v2, pecl - extensions: ds - - - name: Install dependencies - run: composer install --no-progress --prefer-dist --optimize-autoloader - - - name: Analyze code with static-analysis - run: vendor/bin/phpstan analyse --no-progress - - unit-tests: - name: "Unit Tests" - runs-on: "${{ matrix.os }}" - continue-on-error: "${{ matrix.experimental }}" - strategy: - fail-fast: false - matrix: - php: [ "7.4", "8.0", "8.1" ] - os: [ "ubuntu-latest" ] - experimental: [ false ] - - steps: - - name: Checkout - uses: actions/checkout@v2.4.0 - - - name: Setup PHP - uses: shivammathur/setup-php@2.16.0 - with: - php-version: ${{ matrix.php }} - tools: composer:v2, pecl - extensions: ds - - - name: Install dependencies - run: composer install --no-progress --prefer-dist --optimize-autoloader ${{ matrix.composer-options }} - - - name: Execute tests - run: vendor/bin/phpunit --colors=always --coverage-text From c2b4825533348faf3e17530d0aff3d7f4fd7fbf4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20Fr=C3=B6mer?= Date: Tue, 4 Jan 2022 15:57:11 +0100 Subject: [PATCH 3/3] Ignore composer.lock --- .gitignore | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/.gitignore b/.gitignore index a67d42b..3a9875b 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,2 @@ -composer.phar /vendor/ - -# Commit your application's lock file https://getcomposer.org/doc/01-basic-usage.md#commit-your-composer-lock-file-to-version-control -# You may choose to ignore a library lock file http://getcomposer.org/doc/02-libraries.md#lock-file -# composer.lock +composer.lock