diff --git a/.codeclimate.yml b/.codeclimate.yml new file mode 100644 index 0000000..7dd6938 --- /dev/null +++ b/.codeclimate.yml @@ -0,0 +1,39 @@ +--- +version: "2" +plugins: + duplication: + enabled: true + config: + languages: + - php + fixme: + enabled: true + markdownlint: + enabled: true + phpcodesniffer: + enabled: true + config: + file_extensions: "php" + standard: "WordPress-Docs,WordPress-Extra" + phpmd: + enabled: true + checks: + Controversial/CamelCaseMethodName: + enabled: false + Controversial/CamelCaseParameterName: + enabled: false + Controversial/CamelCasePropertyName: + enabled: false + Controversial/CamelCaseVariableName: + enabled: false + CleanCode/ElseExpression: + enabled: false + shellcheck: + enabled: true +exclude_patterns: + - "**.dist" + - "**.lock" + - "**.json" + - "**.txt" + - "tests/*" + - "vendor/**" diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..e1cc194 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,21 @@ +# This file is for unifying the coding style for different editors and IDEs +# editorconfig.org + +# WordPress Coding Standards +# https://make.wordpress.org/core/handbook/coding-standards/ + +root = true + +[*] +charset = utf-8 +end_of_line = lf +insert_final_newline = true +trim_trailing_whitespace = true +indent_style = tab + +[{.jshintrc,*.json,*.yml}] +indent_style = space +indent_size = 2 + +[{*.txt,wp-config-sample.php}] +end_of_line = crlf diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..a4fdc68 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,25 @@ +# Set the default behavior, in case people don't have core.autocrlf set. +* text=auto + +# Explicitly declare text files that will always be normalized and converted +# to native line endings on checkout. +.editorconfig text +.gitattributes text +.gitignore text +*.json text +*.md text +*.txt text +*.xml text +*.yml text + +# Declare files that will always have LF line endings on checkout. +*.php text eol=lf +*.sh text eol=lf + +# Exclude from export. +.* export-ignore +bin export-ignore +tests export-ignore +*.dist export-ignore +CODE_OF_CONDUCT.md export-ignore +composer.* export-ignore diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md new file mode 100644 index 0000000..5380d83 --- /dev/null +++ b/.github/CONTRIBUTING.md @@ -0,0 +1,23 @@ +# Want to contribute? + +Did you know that you could be instrumental in making the WP Bootstrap NavWalker more robust? If you use and love it, why not contribute to the project? + +## Contributing for Everyone! + +Whether you can barely recognize a filter (or don’t know what that means) or you’ve already authored your own plugins, there are ways for you to pitch in. + +### Create Bug Reports + +If you find a bug, just [file a GitHub issue](https://github.com/wp-bootstrap/wp-bootstrap-navwalker/issues), that’s all. If you want to prefix the title with a “Question:”, “Bug:”, or the general area of the application, that would be helpful, but by no means mandatory. If you have write access, add the appropriate labels. + +If you’re filing a bug, specific steps to reproduce are helpful. Please include the URL of the page that has the bug, along with what you expected to see and what happened instead. + +### Write and submit a patch + +If you'd like to fix a bug, you can submit a Pull Request. + +#### Where to get started? + +If you'd like to contribute but don't know where to get started, you can take a look at existing issues: + +- ["Good First Bug"](https://github.com/wp-bootstrap/wp-bootstrap-navwalker/labels/%5BTYPE%5D%20GOOD%20FIRST%20BUG) issues are a good entry point to get familiar with the codebase. diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md new file mode 100644 index 0000000..048637d --- /dev/null +++ b/.github/ISSUE_TEMPLATE.md @@ -0,0 +1,15 @@ + + +#### Steps to reproduce the issue: + +#### What I expected: + +#### What happened instead: + + diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000..1d6c1e5 --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,12 @@ +Fixes # + +#### Changes proposed in this Pull Request: + +* + +#### Testing instructions: + +* + + +#### Proposed changelog entry for your changes: diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..484a761 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +/vendor/ +/phpcs.xml diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..0a6d59c --- /dev/null +++ b/.travis.yml @@ -0,0 +1,75 @@ +language: php + +os: + - linux + +dist: bionic + +php: + - 7.4 + - 7.3 + - 7.2 + - 7.1 + - nightly + +env: + - WP_VERSION=latest WP_MULTISITE=0 PHPUNIT_VERSION="^5.7" + - WP_VERSION=latest WP_MULTISITE=1 PHPUNIT_VERSION="^5.7" + +services: + - mysql + +jobs: + include: + - php: 7.0 + dist: xenial + env: + - WP_VERSION=latest WP_MULTISITE=0 PHPUNIT_VERSION="^5.7" + - php: 7.0 + dist: xenial + env: + - WP_VERSION=latest WP_MULTISITE=1 PHPUNIT_VERSION="^5.7" + - php: 5.6 + dist: xenial + env: + - WP_VERSION=latest WP_MULTISITE=0 PHPUNIT_VERSION="^5.7" + - php: 5.6 + dist: xenial + env: + - WP_VERSION=latest WP_MULTISITE=1 PHPUNIT_VERSION="^5.7" + - name: "Coding Standars" + php: 7.4 + install: + - composer require --dev wp-coding-standards/wpcs dealerdirect/phpcodesniffer-composer-installer + # Counter wp-enforcer + - rm -f ./phpcs.xml + script: + - vendor/bin/phpcs + - name: "Static Analysis" + php: 7.4 + install: + - composer require --dev szepeviktor/phpstan-wordpress + script: + - vendor/bin/phpstan analyze + allow_failures: + - php: nightly + +branches: + only: + - master + +cache: + directories: + - "${HOME}/.composer/cache" + +install: + - bin/install-wp-tests.sh wordpress_test root "" localhost "${WP_VERSION}" + - composer global require --dev "phpunit/phpunit=${PHPUNIT_VERSION}" + +script: + - "${HOME}/.composer/vendor/bin/phpunit" + +notifications: + email: + on_success: never + on_failure: change diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..850ced5 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,90 @@ +#CHANGELOG + +## [4.3.0] +- Added an `aria-current` item. +- Added `.nav-item` for the `