-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #10 from infinum/develop
Refactoring
- Loading branch information
Showing
27 changed files
with
924 additions
and
208 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
Hi there! Thanks for helping out in improving Eightshift Libs. | ||
|
||
## Reporting an issue | ||
|
||
If you are not sure how something works be sure to read our [readme](https://github.com/infinum/eightshift-libs/blob/master/README.md) and [wiki](https://github.com/infinum/eightshift-libs/wiki). If you found a bug in the code, please [open an issue](https://github.com/infinum/eightshift-libs/issues/new) and follow the instructions in the issue template. | ||
|
||
## Contributing patches and new features | ||
|
||
If you found a bug and want to fix it, or you want to add some new and cool feature, [fork](https://github.com/infinum/wp-boilerplate#fork-destination-box) our repository, then create a `feature` branch from the `master` branch. For instance `feature/some-bug-fix` or `feature/some-cool-new-feature`. | ||
|
||
Once you've coded things up, be sure you check that your code is following our [coding standards](https://github.com/infinum/coding-standards-wp). Also test that your code isn't breaking anything :) | ||
|
||
Then submit a pull request to `develop` branch. Once we check everything we'll merge the changes into `master` with correct version correction (noted by the milestone flag and `future release` tag). | ||
|
||
## Integration testing | ||
|
||
If you want to create integration tests for your code that would be great. We will add some in due time, and they are not necessary for a PR. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
<!--- Hi there! We see that you like our boilerplate and you have found an issue. --> | ||
<!--- This means a lot to us, because it help us improving our code :) --> | ||
<!--- Please use the Title field to provide a clear summary of the issue. --> | ||
|
||
<!-- These comments won't be shown in the issue, but will help in creating a better | ||
issue tracker, so that the maintainers of this project can help track the bug down and | ||
squash it, or sort out any misunderstanding about the code. | ||
Use the Preview link to see the final version before submitting. --> | ||
|
||
## Current Behavior | ||
<!--- If describing a bug, tell us what happens instead of the expected behavior --> | ||
<!--- If suggesting a change/improvement, explain the difference from current behavior --> | ||
|
||
## Expected Behavior | ||
<!--- If you're describing a bug, tell us what should happen --> | ||
<!--- If you're suggesting a change/improvement, tell us how it should work --> | ||
|
||
## Possible Solution | ||
<!--- Not obligatory, but suggest a fix/reason for the bug, --> | ||
<!--- or ideas how to implement the addition or change --> | ||
|
||
## Steps to Reproduce (for bugs) | ||
<!--- Provide a link to a live example, or an unambiguous set of steps to --> | ||
<!--- reproduce this bug. Include code to reproduce, if relevant, that means a lot to us --> | ||
1. | ||
2. | ||
3. | ||
4. | ||
|
||
## Your Environment | ||
<!--- Include as many relevant details about the environment you experienced the bug in --> | ||
* PHP version: | ||
* Development environment: <!-- For development: MAMP, XAMPP, VVV, Docker, Laravel Valet, none if on live server --> | ||
* Server type: <!-- Apache, Nginx, IIS --> | ||
* Operating System and version: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
vendor | ||
node_modules |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
# 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, sex characteristics, gender identity and expression, | ||
level of experience, education, socio-economic status, 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]. 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 https://www.contributor-covenant.org/version/1/4/code-of-conduct.html | ||
|
||
[homepage]: https://www.contributor-covenant.org | ||
|
||
For answers to common questions about this code of conduct, see | ||
https://www.contributor-covenant.org/faq |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,29 @@ | ||
# Eightshift Libs | ||
|
||
TBD | ||
This library is aimed at bringing the modern development tools to the [Eightshift WordPress Boilerplate](https://github.com/infinum/wp-boilerplate), but you can use it on any WordPress project. | ||
|
||
It uses central service instantiator that instatiates all classes that obey single responsibility principle (SRP). Every class is responsible for registering its own hooks. This provides a more testable environment for your project. | ||
|
||
We provide some helpers, abstract classes, interfaces and abstractions on original WordPress functionlality to help you write more modern code. | ||
|
||
Provided functionality: | ||
* Main theme/plugin entrypoint. | ||
* Post Type Registration. | ||
* Taxonomy Registration. | ||
* Gutenberg Blocks Registration. | ||
* Assets Manifest data. | ||
|
||
## :mailbox: Who do I talk to? | ||
|
||
For questions talk to: | ||
|
||
* [[email protected]]([email protected]) | ||
* [[email protected]]([email protected]) | ||
* [[email protected]]([email protected]) | ||
* [[email protected]]([email protected]) | ||
|
||
Eightshift WordPress Boilerplate is maintained and sponsored by Eightshift and Infinum. | ||
|
||
## :scroll: License | ||
|
||
Eightshift WordPress Boilerplate is Copyright ©2019 Eightshift. It is free software, and may be redistributed under the terms specified in the LICENSE file. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
#!/usr/bin/env bash | ||
|
||
# pre-commit.sh | ||
# | ||
# This hook is ran every time a commit is attempted. For commit to pass, the minimum requirement is that | ||
# WPCS checks pass. | ||
|
||
PROJECT=`php -r "echo dirname(dirname(realpath('$0')));"` | ||
STAGED_FILES_CMD=`git diff --cached --name-only --diff-filter=ACMR HEAD | grep \\\\.php` | ||
|
||
#Determine if a file list is passed | ||
if [ "$#" -eq 1 ] | ||
then | ||
oIFS=$IFS | ||
IFS=' | ||
' | ||
SFILES="$1" | ||
IFS=$oIFS | ||
fi | ||
SFILES=${SFILES:-$STAGED_FILES_CMD} | ||
|
||
echo "-----------------" | ||
echo "Checking PHP Lint" | ||
echo "-----------------" | ||
for FILE in $SFILES | ||
do | ||
php -l -d display_errors=0 $PROJECT/$FILE | ||
if [ $? != 0 ] | ||
then | ||
echo "Fix the error before commit." | ||
exit 1 | ||
fi | ||
FILES="$FILES $PROJECT/$FILE" | ||
done | ||
|
||
if [ "$FILES" != "" ] | ||
then | ||
echo "--------------------" | ||
echo "Running Code Sniffer" | ||
echo "--------------------" | ||
composer check-cs -- -p --parallel=4 --colors $FILES | ||
if [ $? != 0 ] | ||
then | ||
echo "Possible warnings and errors found." | ||
exit 1 | ||
fi | ||
fi | ||
|
||
exit $? |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.