About Features Downloads Getting Started Documentation Events Support GitHub

Love VuFind®? Consider becoming a financial supporter. Your support helps build a better VuFind®!

Site Tools


Warning: This page has not been updated in over over a year and may be outdated or deprecated.
development:recommended_tools

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Next revisionBoth sides next revision
development:recommended_tools [2016/09/15 14:16] – [Dependency Management] crhallbergdevelopment:recommended_tools [2021/04/13 11:23] demiankatz
Line 7: Line 7:
 Some developers prefer to use a simple text editor to quickly and easily edit individual files. Others prefer a full-fledged IDE (Integrated Development Environment) which imposes a "whole project" view of the code and includes a built-in understanding of the code which enables it to detect errors, make suggestions and offer navigational shortcuts during programming. As a general rule, an IDE has a steeper learning curve than a basic editor and consumes more resources; however, it offers great advantages when undertaking more complex programming tasks. Basic text editors can offer more speed, and some also include plug-ins to enable certain IDE-like functionality. Some developers prefer to use a simple text editor to quickly and easily edit individual files. Others prefer a full-fledged IDE (Integrated Development Environment) which imposes a "whole project" view of the code and includes a built-in understanding of the code which enables it to detect errors, make suggestions and offer navigational shortcuts during programming. As a general rule, an IDE has a steeper learning curve than a basic editor and consumes more resources; however, it offers great advantages when undertaking more complex programming tasks. Basic text editors can offer more speed, and some also include plug-ins to enable certain IDE-like functionality.
  
-At Villanova, Demian uses the [[https://netbeans.org/|Netbeans IDE]] for most of his work, while Chris uses the [[https://notepad-plus-plus.org/|Notepad++]] text editor.+At Villanova, Demian uses the free, open source [[https://code.visualstudio.com/|Visual Studio Code]] IDE for most of his work (and has previously been successful using [[https://netbeans.org/|Netbeans]]), while Chris uses the [[https://notepad-plus-plus.org/|Notepad++]] text editor.
  
 ===== Version Control ===== ===== Version Control =====
Line 23: Line 23:
  
 The VuFind project includes [[development:testing:unit_tests|unit tests]] and automated code style checks designed to insure the consistency and integrity of the code. Whenever a Git commit is made or a GitHub pull request is opened, [[development:testing:continuous_integration|continuous integration]] processes run to validate the changes, and alerts will be thrown if anything breaks. The VuFind project includes [[development:testing:unit_tests|unit tests]] and automated code style checks designed to insure the consistency and integrity of the code. Whenever a Git commit is made or a GitHub pull request is opened, [[development:testing:continuous_integration|continuous integration]] processes run to validate the changes, and alerts will be thrown if anything breaks.
 +
 +==== Checking Everything ====
 +
 +While you can open a pull request and check for problems after the fact through GitHub's interface, it is also possible to run checks prior to submission, which may save you some time. To run all the tests and code quality checks locally, run the following command from your VuFind home directory:
 +
 +<code>
 +vendor/bin/phing eslint jshint phpunitfast phpcs-console php-cs-fixer-dryrun checkLessToSass phpstan-console
 +</code>
  
 ==== Tests ==== ==== Tests ====
Line 30: Line 38:
 ==== Style ==== ==== Style ====
  
-For style compliance, it is recommended that you install [[https://github.com/squizlabs/PHP_CodeSniffer|PHP_CodeSniffer]] and [[https://github.com/FriendsOfPHP/PHP-CS-Fixer|PHP-CS-fixer]], each of which is capable of detecting (and sometimes automatically fixing) different issues.+For style compliance, VuFind uses [[https://github.com/squizlabs/PHP_CodeSniffer|PHP_CodeSniffer]] and [[https://github.com/FriendsOfPHP/PHP-CS-Fixer|PHP-CS-fixer]], each of which is capable of detecting (and sometimes automatically fixing) different issues. In recent versions of VuFind, these tools will be installed automatically by Composer.
  
-To test style compliance with PHP_CodeSniffer, you can run:+To test style compliance with PHP_CodeSniffer while in your VuFind directory, you can test a single file with:
  
 <code> <code>
-phpcs --standard=PEAR [file]+vendor/bin/phpcs --standard=PEAR [file]
 </code> </code>
  
-To automatically fix certain PHP_CodeSniffer issues, you can run:+Or, through [[https://www.phing.info/|Phing]], you can check the whole project:
  
 <code> <code>
-phpcbf --standard=PEAR [file]+vendor/bin/phing phpcs-console
 </code> </code>
  
-To automatically fix additional issues with php-cs-fixer, you can install [[https://www.phing.info/|Phing]] and then, from the base of your VuFind directory, run:+To automatically fix certain PHP_CodeSniffer issues, you can run:
  
 <code> <code>
-phing php-cs-fixer+vendor/bin/phing phpcbf
 </code> </code>
  
-(Note that this assumes that the php-cs-fixer command is accessible on your search path).+To automatically fix additional issues with php-cs-fixer, from the base of your VuFind directory, run: 
 + 
 +<code> 
 +vendor/bin/phing php-cs-fixer 
 +</code>
  
 If you are unwilling or unable to run these tools locally, note that if you open a pull request against the [[https://github.com/vufind-org/vufind|main VuFind repo]], they will be automatically run by [[development:testing:continuous_integration|continuous integration]] and you can view a list of issues in the resulting Travis report. Before you spend time manually fixing anything, you can post a comment on the pull request to ask for assistance with running the automatic processes. If you are unwilling or unable to run these tools locally, note that if you open a pull request against the [[https://github.com/vufind-org/vufind|main VuFind repo]], they will be automatically run by [[development:testing:continuous_integration|continuous integration]] and you can view a list of issues in the resulting Travis report. Before you spend time manually fixing anything, you can post a comment on the pull request to ask for assistance with running the automatic processes.
 +
 +==== Static Analysis ====
 +
 +VuFind uses [[https://phpstan.org/|PHPStan]] for static code analysis; it helps detect common programming errors like incorrect types, unused variables, etc. Paying attention to PHPStan reports can help you write better-quality code and avoid subtle bugs. To run a PHPStan test, you can use this command:
 +
 +<code>
 +vendor/bin/phing phpstan-console
 +</code>
 ---- struct data ---- ---- struct data ----
 ---- ----
  
development/recommended_tools.txt · Last modified: 2023/10/20 12:02 by demiankatz