From 68fca551c9812f391a0a49dca1204efbb903b804 Mon Sep 17 00:00:00 2001 From: Chemaclass Date: Sun, 30 Oct 2022 17:26:23 +0100 Subject: [PATCH] Add .github/* files --- .github/CODE_OF_CONDUCT.md | 41 +++++++++++++++++++ .github/CONTRIBUTING.md | 68 ++++++++++++++++++++++++++++++++ .github/FUNDING.yml | 1 + .github/PULL_REQUEST_TEMPLATE.md | 7 ++++ README.md | 37 ++++------------- 5 files changed, 125 insertions(+), 29 deletions(-) create mode 100644 .github/CODE_OF_CONDUCT.md create mode 100644 .github/CONTRIBUTING.md create mode 100644 .github/FUNDING.yml create mode 100644 .github/PULL_REQUEST_TEMPLATE.md diff --git a/.github/CODE_OF_CONDUCT.md b/.github/CODE_OF_CONDUCT.md new file mode 100644 index 0000000..3b9c8da --- /dev/null +++ b/.github/CODE_OF_CONDUCT.md @@ -0,0 +1,41 @@ +# Contributor Code of Conduct + +As contributors and maintainers of this project, and in the interest of fostering an open and welcoming community, we +pledge to respect all people who contribute through reporting issues, posting feature requests, updating documentation, +submitting pull requests or patches, and other activities. + +We are committed to making participation in this project a harassment-free experience for everyone, regardless of level +of experience, gender, gender identity and expression, sexual orientation, disability, personal appearance, body size, +race, ethnicity, age, religion, or nationality. + +Examples of unacceptable behavior by participants include: + +* The use of sexualized language or imagery +* Personal attacks +* Trolling or insulting/derogatory comments +* Public or private harassment +* Publishing other's private information, such as physical or electronic addresses, without explicit permission +* Other unethical or unprofessional conduct + +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. + +By adopting this Code of Conduct, project maintainers commit themselves to fairly and consistently applying these +principles to every aspect of managing this project. Project maintainers who do not follow or enforce the Code of +Conduct may be permanently removed from the project team. + +This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the +project or its community. + +Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project maintainer +at chemaclass@outlook.es. All complaints will be reviewed and investigated and will result in a response that is deemed +necessary and appropriate to the circumstances. Maintainers are obligated to maintain confidentiality with regard to the +reporter of an incident. + +This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.3.0, available +at [https://contributor-covenant.org/version/1/3/0/][version] + +[homepage]: https://contributor-covenant.org + +[version]: https://contributor-covenant.org/version/1/3/0/ diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md new file mode 100644 index 0000000..ed5db79 --- /dev/null +++ b/.github/CONTRIBUTING.md @@ -0,0 +1,68 @@ +# Contributing to Gacela + +## Welcome! + +We look forward to your contributions! + +## We have a Code of Conduct + +Please note that this project is released with a [Contributor Code of Conduct](CODE_OF_CONDUCT.md). By participating in this project you agree to abide by its terms. + +## Any contributions you make will be under the MIT License + +When you submit code changes, your submissions are understood to be under the same [MIT](https://github.com/Chemaclass/EdifactParser/blob/master/LICENSE) that covers the project. By contributing to this project, you agree that your contributions will be licensed under its MIT. + +## Write bug reports with detail, background, and sample code + +In your bug report, please provide the following: + +* A quick summary and/or background +* Steps to reproduce + * Be specific! + * Give sample code if you can. +* What you expected would happen +* What actually happens +* Notes (possibly including why you think this might be happening, or stuff you tried that didn't work) + +Please post code and output as text ([using proper markup](https://guides.github.com/features/mastering-markdown/)). +Do not post screenshots of code or output. + +## Workflow for Pull Requests + +1. Fork/clone the repository. +2. Install the vendor dependencies with `composer update`. +3. Create your branch from `master` if you plan to implement new functionality or change existing code significantly; + create your branch from the oldest branch that is affected by the bug if you plan to fix a bug. +4. Implement your change and add tests for it. +5. Ensure the test suite passes. +6. Ensure the code complies with our coding guidelines (see below). +7. Send that pull request! + +Please make sure you have [set up your username and email address](https://git-scm.com/book/en/v2/Getting-Started-First-Time-Git-Setup) for use with Git. Strings such as `silly nick name ` look really stupid in the commit history of a project. + +## Coding Guidelines + +This project comes with some configuration files (located at `/psalm.xml` & `/phpstan.neon`) that you can use to perform static analysis (with a focus on type checking): + +```bash +$ ./vendor/bin/psalm +$ ./vendor/bin/phpstan +``` + +This project comes with a configuration file (located at `/.php-cs-fixer.dist.php` in the repository) that you can use to (re)format your source code for compliance with this project's coding guidelines: + +```bash +$ ./vendor/bin/php-cs-fixer fix +``` + +Please understand that we will not accept a pull request when its changes violate this project's coding guidelines. + +## Running Gacela's test suite + +Once you've installed all composer dependencies, you can simply test all suites running the following composer script: + +```bash +$ composer test-all +``` + +You can see more composer scripts inside the `/composer.json` file. diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml new file mode 100644 index 0000000..044078a --- /dev/null +++ b/.github/FUNDING.yml @@ -0,0 +1 @@ +custom: ["https://www.paypal.me/chemaclass"] diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000..96a2bad --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,7 @@ +## 📚 Description + +Replace this text with a short description of your feature/bugfix. + +## 🔖 Changes + +- List individual changes in more detail diff --git a/README.md b/README.md index 7efd7ed..f158292 100644 --- a/README.md +++ b/README.md @@ -22,41 +22,20 @@ Ok, but... [What is EDIFACT?](/docu/README.md) * A transaction is the list of messages that belongs to a file. -## Installation as vendor - -Using composer: ```composer require chemaclass/edifact-parser``` - -## Development - -### Requirements - -You need PHP >=8.0 and composer to install the dependencies. - -Alternatively, you can use [docker](./devops/dev/php.dockerfile) - -#### Setup - -Clone/Fork the project and go inside the repository. -There you can use docker-compose to create and run the docker image. -Go inside the container and run composer install to install all dependencies. -You can easily check is working running the example code. +### Installation ```bash -docker-compose up -docker exec -ti -u dev edifact_parser_php bash -composer install -php example/extracting-data.php -php example/printing-segments.php +composer require chemaclass/edifact-parser ``` -### Composer scripts +### Contribute -```bash -composer csfix # fix the style using php-cs-fixer -composer test-all # execute phpunit tests -``` +You are more than welcome to contribute reporting +[issues](https://github.com/gacela-project/gacela/issues), +sharing [ideas](https://github.com/gacela-project/gacela/discussions), +or [contributing](.github/CONTRIBUTING.md) with your Pull Requests. -## Basic examples +### Basic examples You can see a full example of [printing segments](example/printing-segments.php).