Skip to content

Asterisk (*) added at end of ignore pattern, bug? #26

Open
@mikaello

Description

@mikaello

When defining an ignore pattern, e.g. FILE_TRAILING_NEWLINE_IGNORE=".git,*.svg,*.excalidraw", the resulting path will get an * added at the end. Example:

`find . -type f -not \( -path "./.git*" -o -path "./*.svg*" -o -path "./*.excalidraw*" \) ! -size 0 -print0 | xargs -0 -P 8 -n1 grep -Il '' | tr '\n' '\0' | xargs -0 -P 8 -n1 sh -c 'if [ -f "${1}" ]; then aci-trailing-newline -n "$1" || echo "$1: No trailing newline at EOF."; fi' --`

This seems like a bug, this makes it impossible to only match files with certain extensions without also matching files having that extension in the middle of the file name, e.g. somefile.excalidraw.custom_ending will also be ignored.

It seems like this is the code responsible:

#
# 'find' pattern for ignores/excludes
#
if [ "${MY_IGN}" != "" ]; then
EXCL_PATTERN="-not \( -path \"${MY_PATH}/${MY_IGN//,/*\" -o -path \"${MY_PATH}\/}*\" \)"
else
EXCL_PATTERN=""
fi

would it be possible to not add an asterisk at the end?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions