Skip to content
This repository has been archived by the owner on Mar 1, 2023. It is now read-only.

Commit

Permalink
first commit
Browse files Browse the repository at this point in the history
Added build files to travis and updated wrong php version

fixed travis
  • Loading branch information
prisis committed May 1, 2018
1 parent 35f20ed commit 459f66a
Show file tree
Hide file tree
Showing 21 changed files with 5,930 additions and 1 deletion.
13 changes: 13 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
root = true

[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true
indent_style = space
indent_size = 4
trim_trailing_whitespace = true

[*.yml]
indent_style = space
indent_size = 2
17 changes: 17 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
* text=auto
*.php text eol=lf

tests export-ignore

.php_cs export-ignore
.gitattributes export-ignore
.gitignore export-ignore
.travis.yml export-ignore
phpstan.neon export-ignore
package.json export-ignore

phpunit.xml.dist export-ignore

CONTRIBUTING.md export-ignore
README.md export-ignore
CODE_OF_CONDUCT.md export-ignore
11 changes: 11 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Your tools may add their own folders and files to the project.
# Ignoring those within your global gitignore will make it so
# they will never get commited within any project you have.

.php_cs.cache
coverage.xml

composer.phar

/build/logs
/vendor
18 changes: 18 additions & 0 deletions .php_cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?php
use Narrowspark\CS\Config\Config;

$config = new Config();
$config->getFinder()
->files()
->in(__DIR__)
->exclude('build')
->exclude('vendor')
->name('*.php')
->ignoreDotFiles(true)
->ignoreVCS(true);

$cacheDir = getenv('TRAVIS') ? getenv('HOME') . '/.php-cs-fixer' : __DIR__;

$config->setCacheFile($cacheDir . '/.php_cs.cache');

return $config;
52 changes: 52 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
dist: trusty
language: php

env:
global:
- TEST="./vendor/bin/phpunit --verbose"
- COMPOSER_UP="composer update --no-interaction --prefer-dist --no-progress --profile --no-suggest"

cache:
yarn: true
directories:
- $HOME/.composer/cache
- $HOME/.php-cs-fixer

before_install:
- stty cols 120
- chmod a+x ./build/travis/configure_php.sh
- ./build/travis/configure_php.sh

install:
- composer global require hirak/prestissimo
- $COMPOSER_UP

jobs:
include:
- stage: Test
php: 7.2
env: REMOVE_XDEBUG=true

- stage: Coding standard
php: 7.2
env: REMOVE_XDEBUG=true
script:
- ./vendor/bin/php-cs-fixer fix --verbose --diff --dry-run
- stage: Coding standard
php: 7.2
env: REMOVE_XDEBUG=false
script:
- ./vendor/bin/phpstan analyse -c phpstan.neon -l 7 src

- stage: Coverage
php: 7.2
env: REMOVE_XDEBUG=false
script:
- bash -xc "$TEST -c ./phpunit.xml.dist --coverage-clover=coverage.xml"
after_success:
- bash <(curl -s https://codecov.io/bash)

notifications:
email:
on_success: never
on_failure: change
74 changes: 74 additions & 0 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
# 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 [[email protected]](mailto:[email protected]). All
complaints will be reviewed and investigated and will result in a response that
is deemed necessary and 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/
116 changes: 116 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
<h1 align="center">Narrowspark Contributing Guidelines</h1>

Thank you for wanting to contribute to narrowspark!

You can find below our guidelines for contribution, explaining how to send [pull requests](#pull-requests), [report issues](#filling-bugs) and [ask questions](#asking-questions), as well as which [workflow](#workflow) we're using while developing narrowspark.

## Maintainers

Current maintainers of narrowspark are:

- [Daniel Bannert](https://github.com/prisis),

If you'll have any questions, feel free to mention us or use emails from our profiles to contact us.


## How you can help

You're welcomed to:

- send pull requests;
- report bugs;
- ask questions;
- fix existing issues;
- suggest new features and enhancements;
- write, rewrite, fix and enhance docs;
- contribute in other ways if you'd like.


### Pull-requests

If you fixed or added something useful to the project, you can send a pull-request. It will be reviewed by a maintainer and accepted, or commented for rework, or declined.

#### Before submitting a PR:

1. Make sure you have tests for your modifications.
2. Run phpunit test locally to catch any errors.
3. Check the code style with ``$ php vendor/bin/php-cs-fixer fix --config-file=.php_cs -v --diff --dry-run`` and fix it with ``$ php vendor/bin/php-cs-fixer fix --config-file=.php_cs -v``.

#### Why did you close my pull request or issue?

Nothing is worse than a project with hundreds of stale issues. To keep things orderly, the maintainers try to close/resolve issues as quickly as possible.

#### PR/Issue closing criteria

We'll close your PR or issue if:

1. It's a duplicate of an existing issue.
2. Outside of the scope of the project.
3. The bug is not reproducible.
4. You are unresponsive after a few days.
5. The feature request introduces too much complexity (or too many edge cases) to the tool
- We weigh a request's complexity with the value it brings to the community.

Please do not take offense if your ticket is closed. We're only trying to keep the number of issues manageable.

### Filling bugs

If you found an error, typo, or any other flaw in the project, please report it using [GitHub Issues](https://github.com/narrowspark/framework/issues). Try searching the issues to see if there is an existing report of your bug, and if you'd find it, you could bump it by adding your test case there.

When it comes to bugs, the more details you provide, the easier it is to reproduce the issue and the faster it could be fixed.

The best case would be if you'd provide a minimal reproducible test case illustrating a bug. For most cases just a code snippet would be enough, for more complex cases you can create gists or even test repos on GitHub — we would be glad to look into any problems you'll have with narrowspark.

### Asking questions

GitHub issues is not the best place for asking questions like “why my code won't work” or “is there a way to do X in narrowspark”, but we are constantly monitoring the [narrowspark tag at StackOverflow](http://stackoverflow.com/unanswered/tagged/narrowspark), so feel free to ask there! It would make it easier for other people to get answers and to keep GitHub Issues for bugs and feature requests.

### Fixing existing issues

If you'd like to work on an existing issue, just leave a comment on the issue saying that you'll work on a PR fixing it.

### Proposing features

If you've got an idea for a new feature, file an issue providing some details on your idea. Try searching the issues to see if there is an existing proposal for your feature and feel free to bump it by providing your use case or explaining why this feature is important for you.

We should note that not everything should be done as a “narrowspark feature”, some features better be a narrowspark plug-ins, some are just not in the scope of the project.

* * *

## Workflow

This section describes the workflow we use for narrowspark releases, the naming of the branches and the meaning behind them.

### Branches

#### Permanent branches

The following branches should always be there. Do not fork them directly, always create a new branch for your Pull Requests.

- `master`. The code in this branch should always be equal to the latest version that was published in packagist.

- `develop`. This is a branch for coldfixes — both code and documentation. When you're fixing something, it would make sense to send a PR to this branch and not to the `master` — this would make our job a bit easier.

The code in this branch should always be backwards compatible with `master` — it should only introduce fixes, changes to documentation and other similar things like those, so at every given moment we could create a patch release from it.

#### Temporarily branches

- `issue-NNN`. If you're working on a fix for an issue, you can use this naming. This would make it easy to understand which issue is affected by your code. You can optionally include a postfix with a short description of the problem, for example `issue-1289-broken-mqs`.

- `feature-…`. Any new feature should be initially be a feature-branch. Such branches won't be merged into `master` or `dev` branches directly. The naming would work basically the same as the `issue-…`, but you can omit the issue's number as there couldn't be one issue covering the feature, or you're working on some refactoring.

- `rc-…`. Any new feature release should be at first compiled into a release candidate branch. For example, `rc-0.43` would be a branch for a coming `0.43.0` release. We would merge feature branches and Pull Requests that add new features to the rc-branch, then we test all the changes together, writing tests and docs for those new features and when everything is ready, we increase the version number, then merge the rc-branch into `dev` and `master`.

### Releasing workflow

We follow [semver](http://semver.org/). We're in `0.x` at the moment, however, as narrowspark is already widely used, we don't introduce backwards-incompatible changes to our minor releases.

Each minor release should be first compiled into `rc-`branch. Minor release *should not* have fixes in it, as patch-release should be published before a minor one if there are fixes. This would deliver the fixes to the people using the fixed minor, but `x` at patch version.

Patch releases don't need their own `rc` branches, as they could be released from the `develop` branch.

* * *

This document is inspired my many other Contributing.md files.

**Happy coding**!
Loading

0 comments on commit 459f66a

Please sign in to comment.