Difference between revisions of "Lint"

From Freephile Wiki
Jump to navigation Jump to search
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
 +
{{ambox
 +
|type=content
 +
|text=merge with [[Coding Standards]]}}
 
[[File:Dryer Lint Close.jpg|thumb|Close-up of Dryer Lint]]
 
[[File:Dryer Lint Close.jpg|thumb|Close-up of Dryer Lint]]
  

Latest revision as of 22:17, 17 October 2023

Close-up of Dryer Lint

Cleaning up your filesystem is as important as cleaning the lint out of the dryer screen[1].


Find symbolic links that are broken

find . -type l -! -exec test -e {} \; -print


Syntax checkers[edit | edit source]

The verb 'lint' means to check some code for syntax violations. PHP has a built-in linter that you can invoke from the CLI with the -l switch. For the MediaWiki project, the full list of Continuous Integration entry points describes the tools used in various circumstances. For instance, core uses php-parallel-lint for checking PHP syntax. (See the composer.json file)

Continuous Integration[edit | edit source]

For continuous integration, you want to incorporate your linters into the source code repository as a commit hook. For example, in GitHub, this is referred to as "GitHub Actions". It can be important to make these available as repository hooks for another reason: forks and pull-requests can be done right in the web browser for sites like GitHub meaning you might be merging code that has never been through a true development environment or IDE.

GitHub has a marketplace product called "Super Linter" that basically will lint all the various languages and technologies you could want.

Local Development[edit | edit source]

To bring the warnings (or errors) closer to development, you want to make the tools available in your project as a 'Dev' dependency and setup commands that can be run with Composer. This way developers can use the tools to check their work before committing.

References[edit source]

  1. Real lint from the dryer can be saved and used as an excellent fire-starter -- which is exactly why you also want to periodically clean it out of your ductwork!