How to lint

Started by fsackur, April 23, 2025, 12:27:47 PM

Previous topic - Next topic
What am I doing wrong with the linters?

I had a tiny PR looked at by Franco and Ad. They found lint which wasn't found by `make lint` or `make style`.

In fact, make style gave this output, which looks wrong to me:

FILE: /gitroot/core/src/opnsense/mvc/tests/app/config/config.php
----------------------------------------------------------------------
FOUND 17 ERRORS AFFECTING 1 LINE
----------------------------------------------------------------------
 2 | ERROR | [x] Expected at least 1 space before "."; 0 found
 2 | ERROR | [x] Expected at least 1 space after "."; 0 found
 2 | ERROR | [x] Expected at least 1 space before "."; 0 found
 2 | ERROR | [x] Expected at least 1 space after "."; 0 found
   ...etc...

Deleting the doc comment didn't change the result.

The lint was at https://github.com/opnsense/core/pull/8567/files/65329ce3311d87cb9b3b458149be83103da7f88d#diff-07480bce72d334fe48601b41482cb74c83f5fa9152017c4e1460ab787654e453

Each ascii `.` has a single ascii space each side.
We do this not because it is easy, but because we thought it would be easy

Hi,

This was about "make style-fix" (needs os-debug plugin) or "make sweep" potentially rewriting the lines again.


Cheers,
Franco