1
0
mirror of https://github.com/danog/psalm.git synced 2024-12-13 17:57:37 +01:00
Commit Graph

127 Commits

Author SHA1 Message Date
Matthew Brown
b2c0993cdc Add framework for taint analysis to Psalm
Ref #611
2019-08-04 10:37:36 -04:00
SignpostMarv
9ac78b5d10 add psalm config attribute re: #1804 (#1936)
* add psalm config attribute for controlling the default inclusion of php & php extension version info in the error baseline

* using method recommended by @bdsl in https://github.com/vimeo/psalm/pull/1936#discussion_r302727993
2019-07-12 10:31:12 -04:00
Brown
73b1571bd7 Remove php version from default baseline generation 2019-07-11 10:41:44 -04:00
Barney Laurance
ea83068deb Allow resolving directories from config file location (continued) (#1910)
* Extract function getPsalmHelpText() from psalm.php

* Extract initialiseConfig from psalm.php

* Add -c as valid short option for psalter and psalm-refactor

* Use initialiseConfig in psalter, psalm-refactor and psalm-language-server as well as psalm

* Rely on psalm --alter resolving directory from config file in test

* Remove erronous condition for config file path

This code was based on me wrongly thinking that the config file location
was seprated from the argument name with a space instead of an equals
sign

* Use config dir as current dir in psalm and psalm-refactor, as with psalter and psalm-language-server

* Remove redundant duplicated code

* Refactor: move calls to \Psalm\Config::setComposerClassLoader inside initialiseConfig

* PHPCS fix

* Extract function get_path_to_config from command scripts

* Refactor - extract functions from \Psalm\Config::loadFromXML

* Refactor - reduce verbosity of config loading code

* Allow running e2e tests on windows

* Fix testCompactReport on Windows

* convert line endings to make testCompactReport pass on Windows
2019-07-07 08:55:53 -04:00
Barney Laurance
94f934627c Work in progress - resolve directories from config file location (#1904)
* Add resolveFromConfigFile config option

Treats all paths as relative to the location of the config file, not
the current working directory of the process.

This commit just changes psalm, further commits will be needed to
apply the change to psalter and the LSP server.

* Copy asset xml files into project root for testing, delete during teardown

Needed since paths are now resolved relative to the position of the
file.

Not sure why I only saw a test failre for 1.xml - would have expected it
for all eight files.

* Fix following rebase

* Move psalm --init handly code above working directory setting code

If there's no psalm.xml yet we can't use the location of psalm.xml to
set our working directory

* Move Psalm version output code above working directory resolution

Working directory doesn't need to be known to output version constant

* Rely on new config file based working directory in end to end test

* Dont use rely on config dir for --alter - not currently working

* Fix code style error

* Add failing test for supporting config without `resolveFromConfigFile="true"`

* Don't treat config directory as a path to check

* Document resolveFromConfigFile setting
2019-07-06 12:21:39 -04:00
Mikko Pesari
caf7737bbe Disable progressbar when GitLab CI is detected (#1867) 2019-06-28 11:25:29 -04:00
Mikko Pesari
3c61b17843 Exit with error status on baseline read errors (#1866) 2019-06-28 10:49:57 -04:00
Brown
e54f899858 Add pcre.jit message upfront when running Psalm on Macs
Ref #1855
2019-06-27 10:51:13 -04:00
Matthew Lewinski
ac0a9d1514 Add a 'sonarqube' report type (#1808)
This JSON report is suitable for import into either SonarCloud or
SonarQube as Generic Issue Data (also known as an External Issue
Report).

https://docs.sonarqube.org/latest/analysis/generic-issue/
2019-06-17 21:17:09 -04:00
Matthew Brown
b5cbc84351 Fix #1617 - add option to only show errors in reports 2019-06-09 12:37:28 -04:00
Brown
9573429f1e Always disable uopz
Ref #1741
2019-06-06 10:36:26 -04:00
Matthew Brown
90b160aece Allow extensions to be disabled during --init
Ref #1741
2019-06-06 08:42:44 -04:00
Brown
ae8ccdbcd7 Add add info notification to progress 2019-06-03 11:20:42 -04:00
Matthew Brown
2b0a17c1c8 Add simple tool to move static methods 2019-06-02 01:10:50 -04:00
Brown
6f5da23840 Remove redundant check 2019-05-31 13:22:40 -04:00
Brown
ad18eecc13 Disable progressbar when CI is detected 2019-05-31 13:12:22 -04:00
Brown
7c069a9ba7 Suppress errors when baseline is enabled 2019-05-30 10:42:16 -04:00
Ilija Tovilo
5a14e4b1cf Progress bar (#1709)
* Revert "Revert "Implement better progress""

This reverts commit 4302596654.

* Revert "Revert "Implement dots progress bar""

This reverts commit e41733d789.

* Revert "Revert "Switch to VoidProgress by default""

This reverts commit 304ffeb0a3.

* Revert "Revert "Pass success flag to progress""

This reverts commit 62a690ee4e.

* Improve socket communication

* Use an underscore

* Add means to disable progress

* Add extra newline before progress bar
2019-05-30 10:30:41 -04:00
Matthew Brown
4302596654 Revert "Implement better progress"
This reverts commit 042070d0fd.
2019-05-27 13:07:02 -04:00
Ilija Tovilo
042070d0fd Implement better progress 2019-05-26 23:18:48 -04:00
Brown
335b04186b Add autodiscovery of --init folders based on composer.json 2019-05-09 19:19:33 -04:00
Brown
111abf82da Fix #1616 - allow Psalm to output checkstyle format 2019-05-08 14:26:52 -04:00
Brown
2fe5a72ab7 Fix #1586 - allow use of --find-unused-code as alternative to --find-dead-code 2019-04-30 13:23:18 -04:00
Matthew Brown
cd74e227c1 Remove var_dump 2019-04-21 11:42:43 -04:00
Matthew Brown
d68e501bfa Fix #1528 - double check for missing dependency 2019-04-21 11:30:50 -04:00
Brown
fea9faaec5 Allow psalter to be used in multithreaded mode 2019-04-17 13:15:06 -04:00
Brown
4abdc1503f Prevent --update-baseline from running in --diff mode
Fixes #1566
2019-04-16 18:16:46 -04:00
Brown
ff14f671b1 Add hopefully-more-portable method for evaluating method/property usage 2019-04-16 16:07:48 -04:00
Matthew Brown
c297b91d6f Fix possibly null property 2019-04-14 13:04:25 -04:00
Matthew Brown
d145f17782 Fix #1548 - allow parallel execution with --find-dead-code 2019-04-13 15:38:09 -04:00
Brown
26e2de93c7 Prepare to enable paralellised use of --find-dead-code
References #1548
2019-04-12 18:28:07 -04:00
Matthew Brown
326249e13b spirit => shepherd 2019-03-31 14:02:30 -04:00
Tyson Andre
31e1804ff9 Fix typo in --help ("is base" -> "is based") 2019-03-28 18:02:25 -04:00
Brown
c1434ee212 Add --language-server support 2019-03-27 11:55:10 -04:00
Matthew Brown
ba603acd7b Send build information to remote server 2019-03-23 12:49:37 -04:00
Matthew Brown
94dadee12a Use relative path for config.xsd
Fixes #1472
2019-03-17 15:02:51 -04:00
Brown
bd372e93af Add config flags for findUnusedVariables and findUnusedCode 2019-03-05 15:45:09 -05:00
Roland Franssen
efc0beab6c fix --help end of line 2019-03-04 07:25:58 -05:00
Matthew Brown
9bfabab976 Add support for psalter in Phar 2019-03-03 22:59:00 -05:00
Matthew Brown
674657a51d Fix 7.0-incompatible logic 2019-02-24 01:47:53 -05:00
Matthew Brown
3ad1abece4 Add generation of json artifacts 2019-02-24 01:33:25 -05:00
Bruce Weirdan
faae9fda3b Added option to force dead code detection
Previously Psalm would only check class references when there were no
paths passed on the command line. Now it's possible to force this check
even when paths are specified, with `--find-dead-code=always`.

`--find-dead-code` without a value (or with any value apart from `always`)
will continue to work the same way it did before.
2019-02-18 09:34:28 -05:00
Matthew Brown
574a5530ee Use $baselineFile for current baseline 2019-02-09 11:20:48 -05:00
Maria Luiza Soares
5bd16c686f Show total fixed errors when updating baseline 2019-02-09 11:20:48 -05:00
Matthew Brown
17541b415f Fix #1191 - allow Psalm to check against different versions of PHP 2019-02-07 12:25:57 -05:00
Brown
51c6621925 Add property lookup 2019-01-22 11:10:37 -05:00
Andrii Dembitskyi
dfedf70d5d 🐛 Fix --plugin option handling for psalm 2019-01-08 18:44:43 -05:00
Dave Liddament
5103dfd680 FIX update psalm help text to show you can also generate a report with a .emacs file ending 2018-12-18 17:24:28 -05:00
Jon Ursenbach
c6a8b53a4d Refactoring output formats and creating a new "compact" format.
The new compact format generates your report within a table
structure that is similar to PHPCS.

Resolves #967
2018-12-09 17:34:47 -05:00
Matthew Brown
37dedee7b6 Fix memory leak issues and disable garbage collection 2018-11-18 11:39:14 -05:00