Page MenuHomePhorge

Linter: do not break "ics" files
Closed, ResolvedPublic

Description

It may be nice to add some .ics files in the repository, for example to run extra unit tests on calendar imports.

The problem is, now they trigger unexpected lint errors. Like this one:

Error  (TXT1) DOS Newlines
 You must use ONLY Unix linebreaks ("\n") in source code.

 >>> -      1 BEGIN:VCALENDAR
     -      2 VERSION:2.0

And this lint error:

Error  (TXT5) Bad Charset
    Source code should contain only ASCII bytes with ordinal decimal values
    between 32 and 126 inclusive, plus linefeed. Do not use UTF-8 or other
    multibyte charsets.

              18 SEQUENCE:0
              19 STATUS:CONFIRMED
              20 SUMMARY:A Lincoln, Foo and Alien to FOSDEM 2024
    >>>       21 TRANSP:TRANSPARENT<CR>
              22 END:VEVENT
              23 END:VCALENDAR

Also, the linter asks to auto-fix the mentioned files. But, it actually breaks the expected format:

Apply this patch to
src/applications/calendar/import/__tests__/events/super-brand-new-example-calendar-file-for-unit-tests.ics?
[Y/n]

So at the moment you MUST manually answer "n" to that question to do not break your files.

Expected Behavior

The expected behavior is that these two mentioned lint errors (TXT1 and TXT5) do not appear anymore and the auto-fix does not suggest to break the expected format.

Affected Files

Probably the file that manage this specific lint is:

https://we.phorge.it/source/arcanist/browse/master/src/lint/linter/ArcanistTextLinter.php