forked from Dolibarr/dolibarr
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
51 changed files
with
37,879 additions
and
6 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,43 @@ | ||
name: "CI" | ||
|
||
on: [push, pull_request] | ||
jobs: | ||
pre-commit: | ||
if: false | ||
uses: ./.github/workflows/pre-commit.yml | ||
secrets: inherit | ||
with: | ||
gh_event: ${{ github.event_name }} | ||
phan: | ||
uses: ./.github/workflows/phan.yml | ||
secrets: inherit | ||
with: | ||
gh_event: ${{ github.event_name }} | ||
phpstan: | ||
if: false | ||
uses: ./.github/workflows/phpstan.yml | ||
secrets: inherit | ||
needs: [pre-commit, phan] | ||
with: | ||
gh_event: ${{ github.event_name }} | ||
windows-ci: | ||
if: false | ||
needs: [pre-commit, phan] | ||
secrets: inherit | ||
uses: ./.github/workflows/windows-ci.yml | ||
with: | ||
gh_event: ${{ github.event_name }} | ||
gh-travis: # Runs travis script on github runner (not on travis) | ||
if: false | ||
# needs: [pre-commit, phan] | ||
# needs: [windows-ci] | ||
secrets: inherit | ||
uses: ./.github/workflows/gh-travis.yml | ||
with: | ||
gh_event: ${{ github.event_name }} | ||
|
||
|
||
# Note (not tested, from https://github.com/orgs/community/discussions/38361) | ||
# To cancel jobs if one failes, the following action may help | ||
# - if: "failure()" | ||
# uses: "andymckay/[email protected]" |
Empty 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
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,46 @@ | ||
@ECHO OFF | ||
REM Usage (use from root of project): | ||
REM - Standard checks: | ||
REM PHAN.BAT | ||
REM - Extended checks: | ||
REM PHAN.BAT extended | ||
REM - Use fixer configuration: | ||
REM PHAN.BAT fix | ||
REM | ||
REM Standard phan options can be added on the command line. | ||
|
||
set MEMOPT=--memory-limit=4G | ||
set CONFIG=--config-file | ||
set CONFIG_FILE=dev/tools/phan/config.php | ||
set FIX= | ||
set USERARGS= | ||
SET TWICE=--analyze-twice | ||
|
||
rem Iterate through each argument | ||
for %%i in (%*) do ( | ||
if "%%i"=="--memory-limit" ( | ||
set MEMOPT="" | ||
) | ||
if "%%i"=="extended" ( | ||
set CONFIG="--config-file" | ||
set CONFIG_FILE=dev/tools/phan/config_extended.php | ||
goto :nextloop | ||
) | ||
if "%%i"=="fix" ( | ||
set FIX="--automatic-fix" | ||
set CONFIG="--config-file" | ||
set CONFIG_FILE=dev/tools/phan/config_fixer.php | ||
set TWICE= | ||
goto :nextloop | ||
) | ||
if "%%i"=="--config-file" ( | ||
set CONFIG= | ||
set CONFIG_FILE= | ||
) | ||
set "USERARGS=%USERARGS% %%i" | ||
|
||
:nextloop | ||
REM NEXTLOOP | ||
) | ||
|
||
../phan/vendor/bin/phan.bat %TWICE% %MEMOPT% %FIX% %CONFIG% %CONFIG_FILE% %USERARGS% |
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,46 @@ | ||
### Static Code Checks using [phan] | ||
|
||
#### Installation, running | ||
|
||
`run-phan.sh` can install and run `phan`. | ||
|
||
See instructions in `run-phan.sh` for installing (or just run it). | ||
|
||
The configuration file in `PROJECT_DIR/.phan/config.php` also allows you to run | ||
`phan` independently from the script. | ||
|
||
#### Run options: | ||
|
||
No option : Runs the minimum checks | ||
|
||
Option 'full' : Runs all an extensive set of checks | ||
|
||
Option '1' : Writes the baseline | ||
|
||
Examples: | ||
|
||
- `run-phan.sh` runs the default checks | ||
- `run-phan.sh 1` updates the baseline for the default checks | ||
- `run-phan.sh full` runs the extended checks | ||
- `run-phan.sh full 1` updates the baseline for the extended checks | ||
|
||
#### Baseline | ||
|
||
The `baseline.txt` file in this directory defines the issues that are currently | ||
excluded from the final report. In principle you should not add any more | ||
exceptions to that file, but rather fix the issues or add [phan annotations] | ||
that provide more information or to exclude specific cases. | ||
|
||
#### Configuration | ||
|
||
`config.php` : Default configuration file | ||
|
||
`config_extended.php` : Configuration that enables more checks. | ||
|
||
`baseline.txt` : Ignored issues (with `config.php`) | ||
|
||
`baseline_extended.txt` : Ignored issues (with `config_extended.php`), not | ||
currently in git | ||
|
||
[phan]: https://github.com/phan/phan/wiki/Getting-Started | ||
[phan annotations]: https://github.com/phan/phan/wiki/Annotating-Your-Source-Code |
Large diffs are not rendered by default.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<?php | ||
/** | ||
* /!\ DO NOT generate this baseline - it should only suppress notices | ||
* that are to be excluded from the technical debt and that can | ||
* not be excluded using other methods. | ||
* The 'internal' PhanUndeclaredConstant is such a case. | ||
* | ||
* When Phan is invoked with --load-baseline=path/to/baseline.php, | ||
* The pre-existing issues listed in this file won't be emitted. | ||
* | ||
* This file can be updated by invoking Phan with --save-baseline=path/to/baseline.php | ||
* (can be combined with --load-baseline) | ||
*/ | ||
return [ | ||
|
||
// Currently, file_suppressions and directory_suppressions are the only supported suppressions | ||
'file_suppressions' => [ | ||
'htdocs/accountancy/admin/productaccount.php' => ['PhanTypeMismatchArgumentNullableInternal'], // false positive | ||
'internal' => ['PhanUndeclaredConstant'], | ||
], | ||
// 'directory_suppressions' => ['src/directory_name' => ['PhanIssueName1', 'PhanIssueName2']] can be manually added if needed. | ||
// (directory_suppressions will currently be ignored by subsequent calls to --save-baseline, but may be preserved in future Phan releases) | ||
]; |
Oops, something went wrong.