From 238e55b2fd7f08b5ce866b712c43c1a8fa03a657 Mon Sep 17 00:00:00 2001 From: Alexandre Alapetite Date: Sun, 19 Jun 2022 20:05:46 +0200 Subject: Document fixes & tests (#4418) * Document fixes & tests #fix https://github.com/FreshRSS/FreshRSS/issues/4213 Help https://github.com/FreshRSS/FreshRSS/pull/4400#issuecomment-1159347683 * Link to tests.yml * sudo * Link to GitHub Actions * Add Fedora and Alpine --- docs/en/developers/02_First_steps.md | 47 +++++++++++++++++++++++++++++++++--- 1 file changed, 43 insertions(+), 4 deletions(-) (limited to 'docs/en/developers') diff --git a/docs/en/developers/02_First_steps.md b/docs/en/developers/02_First_steps.md index 9199863a5..929f92a57 100644 --- a/docs/en/developers/02_First_steps.md +++ b/docs/en/developers/02_First_steps.md @@ -69,11 +69,50 @@ If you want to contribute to the source code, it’s important to follow the pro Contributions which don’t follow the coding style will be rejected as long as the coding style is not fixed. -### Checked files via GitHub Actions +## GitHub Actions -The code will be checked within every Pull Request commit on GitHub (via GitHub Actions, config file see `.github/workflows/tests.yml`). +The code will be checked for every pull request commit on GitHub via [GitHub Actions](https://github.com/FreshRSS/FreshRSS/actions). +See the configuration file [`tests.yml`](../../../.github/workflows/tests.yml). -Tests can be run locally, e.g. by running `make test-all` (require npm and node.js installed), and several problems can be automatically fixed by running `make fix-all` +## Running fixes & tests + +Tests can be run locally, e.g. by running `make test-all`, and several problems can be automatically fixed by running `make fix-all`. + +```sh +make fix-all +make test-all +``` + +This requires `make` and `npm` in addition to the FreshRSS requirements. See below for the precise requirements for a few platforms. + +### Debian / Ubuntu + +> ℹ️ Also applies to [Microsoft Windows](https://docs.microsoft.com/windows/wsl/install-win10) thanks to [WSL](https://ubuntu.com/wsl). + +Here are the dependencies that need to be manually installed prior to running the fixes & tests. + +```sh +sudo apt update && sudo apt install --no-install-recommends -y make npm php-cli php-curl php-mbstring php-xml unzip wget +``` + +### Fedora / Red Hat + +```sh +yum install -y git make npm php-cli php-curl php-mbstring php-xml php-pdo unzip wget +``` + +### Alpine Linux + +```sh +apk add git make npm php-cli php-curl php-ctype php-dom php-mbstring php-openssl php-phar php-simplexml php-xml php-pdo php-tokenizer php-xmlwriter unzip wget +``` + +### Partial fixes & tests + +- composer-based: `npm run fix && npm test` or see the [`scripts` section of `composer.json`](../../../composer.json) for individual tests or fixes such as `composer phpstan` +- npm-based: `npm run fix && npm test` or see the [`scripts` section of `package.json`](../../../package.json) for individual tests or fixes such as `npm run rtlcss` + +### Tests summary A short (not complete) summary: @@ -167,7 +206,7 @@ if ((int)$a == 10) { ### With chained functions -It happens most of the time in Javascript files. When there are chained functions with closures and callback functions, it’s hard to understand the code if not properly formatted. In those cases, we add a new indent level for the complete instruction and reset the indent for a new instruction on the same level. +It happens most of the time in JavaScript files. When there are chained functions with closures and call-back functions, it’s hard to understand the code if not properly formatted. In those cases, we add a new indent level for the complete instruction and reset the indent for a new instruction on the same level. ```javascript // First instruction -- cgit v1.2.3