Lint: Difference between revisions
No edit summary |
m Text replacement - "<(\/?)source" to "<$1syntaxhighlight" |
||
(2 intermediate revisions 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]] | ||
Line 5: | Line 8: | ||
Find symbolic links that are broken | Find symbolic links that are broken | ||
< | <syntaxhighlight lang="bash"> | ||
find . -type l -! -exec test -e {} \; -print | find . -type l -! -exec test -e {} \; -print | ||
</ | </syntaxhighlight> | ||
Latest revision as of 13:32, 24 February 2025
merge with Coding Standards |

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]
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]
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]
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]
- ↑ 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!