diff --git a/.codeclimate.yml b/.codeclimate.yml deleted file mode 100644 index 1ff3720ba091f..0000000000000 --- a/.codeclimate.yml +++ /dev/null @@ -1,6 +0,0 @@ ---- -prepare: - fetch: - - url: "https://raw.githubusercontent.com/automattic/jetpack/master/.github/codeclimate-base.yml" - path: "codeclimate-base.yml" - diff --git a/.github/codeclimate-base.yml b/.github/codeclimate-base.yml deleted file mode 100644 index 40f167a7dbed8..0000000000000 --- a/.github/codeclimate-base.yml +++ /dev/null @@ -1,67 +0,0 @@ -# Basic configuration for CodeClimate. -# This basic configuration can then be used and extended up in other repositories, -# or in this one, using the prepare step: -# https://docs.codeclimate.com/docs/configuring-the-prepare-step -# -# Here is how your codeclimate file extending Jetpack's one should look like: -# prepare: -# fetch: -# - url: "https://raw.githubusercontent.com/automattic/jetpack/master/.github/codeclimate-base.yml" -# path: "codeclimate-base.yml" ---- -version: "2" -plugins: - csslint: - enabled: true - duplication: - enabled: true - config: - languages: - - javascript - - php - fixme: - enabled: true - phpcodesniffer: - enabled: true - config: - standard: "WordPress" - phpmd: - enabled: true - eslint: - enabled: true - channel: "eslint-7" - config: - config: "/.eslintrc.js" - extensions: - - .js - - .jsx - scss-lint: - enabled: true - markdownlint: - enabled: true -exclude_patterns: - - "**/.github/**" - - "**/tests/**" - - "**.png" - - "**.jpg" - - "**.gif" - - "gulpfile.js" - - "composer.lock" - - ".phpcs.xml.dist" - - ".phpcs.config.xml" - - "**.json" - - "**.svnignore" - - "**.gitignore" - - "**.eslintrc.js" - - "**.editorconfig" - - "**.pot" - - "**.txt" - - "**-min.js" - - "**-min.css" - - "**.dist" - - "**.sh" -checks: - method-lines: - enabled: false - file-lines: - enabled: false diff --git a/.github/files/process-coverage.sh b/.github/files/process-coverage.sh index 2b31fd8dc69e0..4d1010221ac8e 100755 --- a/.github/files/process-coverage.sh +++ b/.github/files/process-coverage.sh @@ -17,55 +17,3 @@ echo '::endgroup::' echo '::group::Send coverage to codecov.io' bash <(curl -s https://codecov.io/bash) -s ./coverage || echo 'Codecov failed to upload' echo '::endgroup::' - -echo '::group::Send coverage to codeclimate.com' -# Process all the files. -FILES=() -while IFS= read -r FILE; do - TMP="${FILE#coverage/}" - TYPE="${TMP%%/*}" - if [[ "$TYPE" == 'monorepo' ]]; then - DIR="$BASE" - PREFIX="$DIR" - ADD_PREFIX= - else - TMP="${TMP#$TYPE/}" - SLUG="${TYPE}/${TMP%%/*}" - DIR="$BASE/projects/$SLUG" - if [[ "$TYPE" == "plugins" ]]; then - PREFIX="/tmp/wordpress-${WP_BRANCH}/src/wp-content/$SLUG" - else - PREFIX="$DIR" - fi - ADD_PREFIX="projects/$SLUG" - fi - - cd "$DIR" - case "$FILE" in - *clover.xml) - echo "Found clover coverage file $FILE" - "$BASE/cc-test-reporter" format-coverage --prefix "$PREFIX" --add-prefix "$ADD_PREFIX" -t clover -o "$BASE/$FILE.json" "$BASE/$FILE" - FILES+=( "$FILE.json" ) - ;; - *lcov.info) - echo "Found lcov coverage file $FILE" - "$BASE/cc-test-reporter" format-coverage --prefix "$PREFIX" --add-prefix "$ADD_PREFIX" -t lcov -o "$BASE/$FILE.json" "$BASE/$FILE" - FILES+=( "$FILE.json" ) - ;; - *) - echo "Ignoring unrecognized coverage file $FILE" - ;; - esac - cd "$BASE" -done < <(find coverage -type f) - -if [[ "${#FILES[@]}" -gt 0 ]]; then - # Sum all coverage parts into a single coverage/codeclimate.json - ./cc-test-reporter sum-coverage -p "${#FILES[@]}" "${FILES[@]}" - - # Upload coverage/codeclimate.json - ./cc-test-reporter upload-coverage -else - echo 'No coverage files were found.' -fi -echo '::endgroup::' diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 8f78f4867b516..19b3eb5340bb4 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -97,25 +97,6 @@ jobs: restore-keys: | ${{ runner.os }}-yarn- - - name: Init CodeClimate for code coverage - if: matrix.script == 'test-coverage' - env: - CC_TEST_REPORTER_ID: 683bd559e5214ca3b721092af177893f05765ba90d2589fcf35d7e85c6ea01e8 - GH_PR_HEAD_SHA: ${{ github.event.pull_request.head.sha }} - run: | - if [[ "$GITHUB_EVENT_NAME" == "push" ]]; then - GIT_BRANCH="${GITHUB_REF#refs/heads/}" - GIT_COMMIT_SHA="$GITHUB_SHA" - else - GIT_BRANCH="$GITHUB_HEAD_REF" - GIT_COMMIT_SHA="$GH_PR_HEAD_SHA" - fi - echo "GIT_BRANCH=$GIT_BRANCH" >> $GITHUB_ENV - echo "GIT_COMMIT_SHA=$GIT_COMMIT_SHA" >> $GITHUB_ENV - curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter - chmod +x ./cc-test-reporter - ./cc-test-reporter before-build - - name: Detect changed projects id: changed run: | @@ -200,8 +181,6 @@ jobs: - name: Process coverage results if: matrix.script == 'test-coverage' - env: - CC_TEST_REPORTER_ID: 683bd559e5214ca3b721092af177893f05765ba90d2589fcf35d7e85c6ea01e8 run: .github/files/process-coverage.sh - name: Check for artifacts diff --git a/docs/monorepo.md b/docs/monorepo.md index fdae65baaa0f6..c26e0c0aa0986 100644 --- a/docs/monorepo.md +++ b/docs/monorepo.md @@ -198,10 +198,7 @@ If a project contains end-to-end tests, it must define `.scripts.test-e2e` in `c If a project contains PHP or JavaScript tests, it should also define `.scripts.test-coverage` in `composer.json` to run the tests in a mode that will generate code coverage output. -Output should be written to the path specified via the `COVERAGE_DIR` environment variable. Subdirectories of that path may be used as desired, as long as the files themselves are named appropriately. Supported formats are: - -* clover: Name files to end in `clover.xml`. -* lcov: Name files to end in `lcov.info`. Remove any `lcov-report` directories. +Output should be written to the path specified via the `COVERAGE_DIR` environment variable. Subdirectories of that path may be used as desired. For PHP tests, you'll probably run PHPUnit as `phpdbg -qrr "$(which phpunit)" --coverage-clover "$COVERAGE_DIR/clover.xml"`. diff --git a/projects/plugins/jetpack/changelog/remove-codeclimate b/projects/plugins/jetpack/changelog/remove-codeclimate new file mode 100644 index 0000000000000..1bea4135c7db6 --- /dev/null +++ b/projects/plugins/jetpack/changelog/remove-codeclimate @@ -0,0 +1,4 @@ +Significance: patch +Type: other + +Remove CodeClimate diff --git a/projects/plugins/jetpack/readme.md b/projects/plugins/jetpack/readme.md index f36e8ec0e9a1c..aba8805d31008 100644 --- a/projects/plugins/jetpack/readme.md +++ b/projects/plugins/jetpack/readme.md @@ -1,7 +1,6 @@ # Jetpack [![License](https://poser.pugx.org/automattic/jetpack/license.svg)](https://www.gnu.org/licenses/gpl-2.0.html) -[![Code Climate](https://codeclimate.com/github/Automattic/jetpack/badges/gpa.svg)](https://codeclimate.com/github/Automattic/jetpack) [Jetpack](https://jetpack.com/) is a WordPress plugin that supercharges your self-hosted WordPress site with the awesome cloud power of WordPress.com. diff --git a/readme.md b/readme.md index 528dc1e6d7e22..3c4064bbbde3d 100644 --- a/readme.md +++ b/readme.md @@ -1,7 +1,7 @@ # Jetpack Monorepo [![License](https://poser.pugx.org/automattic/jetpack/license.svg)](https://www.gnu.org/licenses/gpl-2.0.html) -[![Code Climate](https://codeclimate.com/github/Automattic/jetpack/badges/gpa.svg)](https://codeclimate.com/github/Automattic/jetpack) +[![codecov](https://codecov.io/gh/Automattic/jetpack/branch/master/graph/badge.svg?token=GmiI6Xl10U)](https://codecov.io/gh/Automattic/jetpack) This is the Jetpack Monorepo. It contains source code for the Jetpack plugin, the Jetpack composer packages, and other things. @@ -16,9 +16,11 @@ To run the Jetpack plugin from the monorepo, you'll first need to build the JS a If you're using the [Docker development environment](./docs/development-environment.md#docker-supported-recommended), you should then be all set. If not, you'll need to create a link to the Jetpack plugin from your WordPress `wp-content/plugins` folder. You'll need to know the filesystem path to the monorepo checkout and to your WordPress installation. Then, on Linux or Mac OS X, open a terminal and use `ln -s` to create the link, something like + ``` ln -s /path/to/jetpack-monorepo/projects/plugins/jetpack /path/to/wordpress/wp-content/plugins/jetpack ``` + On Windows (Vista and later), open an Administrator Command Prompt window and use `mklink /D` similarly. ## Contribute @@ -41,6 +43,7 @@ Need to report a security vulnerability? Go to [https://automattic.com/security/ Jetpack is licensed under [GNU General Public License v2 (or later)](./LICENSE.txt). + ## Team Jetpack is developed and maintained by various teams at Automattic. The Jetpack Crew responsible for coordinating everything is comprised of @adimoldovan, @anomiex, @bisko, @brbrr, @briancolinger, @dereksmart, @fgiannar, @jeherve, @kbrown9, @kraftbj, @leogermani, @mdbitz, @samiff, @sdixon194, @sergeymitr and @zinigor.