universal-ctags / ctags

A maintained ctags implementation
https://ctags.io
GNU General Public License v2.0
6.51k stars 622 forks source link

Containerfile: new parser #3974

Closed masatake closed 5 months ago

masatake commented 6 months ago

Close #3970

codecov[bot] commented 6 months ago

Codecov Report

Attention: Patch coverage is 85.35032% with 23 lines in your changes are missing coverage. Please review.

Project coverage is 85.39%. Comparing base (bfdb3e4) to head (97b7ddb).

Files Patch % Lines
parsers/containerfile.c 85.35% 23 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #3974 +/- ## ========================================== - Coverage 85.39% 85.39% -0.01% ========================================== Files 235 236 +1 Lines 56607 56764 +157 ========================================== + Hits 48337 48471 +134 - Misses 8270 8293 +23 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

masatake commented 5 months ago

I used CPreprocessor as the base parser. Using CPreprocessor as a base is a good choice for Dockerfile.in/Containerfile.in processed by podman. However, the choice can be troublesome for Dockerfile/Containerfile.

Supporting both Dockerfile.in/Containerfile.in and Dockerfile/Containerfile in a parser is not easy.

We may have to have Containerfile parser and ContainerfileIn parser. Sigh.

The behavior of podman for processing \ is very different from what I expected.

$ cat Containerfile
From ubi8:latest
RUN echo hello \

    world
ENV A \

ENV X Y
$ podman build -f Containerfile
STEP 1/3: FROM ubi8:latest
STEP 2/3: RUN echo hello     world
--> Using cache 49aca30d51520057b113038edd4ac22596325950f9f9e9095c2c796962dc9ce6
--> 49aca30d5152
STEP 3/3: ENV A ENV X Y
--> Using cache 510da2bbd3ec0dea46afcb4efc938ceed23ec435e904962722db4f858faff363
--> 510da2bbd3ec
510da2bbd3ec0dea46afcb4efc938ceed23ec435e904962722db4f858faff363

I withdraw this pull request.