Skip to content
This repository has been archived by the owner on Oct 10, 2023. It is now read-only.

Use 'glob-gitignore' instead of 'glob' #31

Merged
merged 3 commits into from
Jul 8, 2021

Conversation

evidolob
Copy link
Collaborator

@evidolob evidolob commented Jul 5, 2021

This PR enhance alizer npm package:

  • Use glob-gitignore instead of glob to list target files, by default it will ignore file/folder listed in .gitignore file
  • Add build npm script (clean + compile)
  • Add new line and end of *.ts files

Signed-off-by: Yevhen Vydolob <yvydolob@redhat.com>
@evidolob
Copy link
Collaborator Author

evidolob commented Jul 5, 2021

cc @jeffmaury @lstocchi

Copy link
Collaborator

@lstocchi lstocchi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried it but it looks like the glob-ignore library doesn't work as expected. If i add a rule (to ignore .java files) inside the .gitignore in the quarkus project used for tests, it still fetches all .java files. Am i missing something?

js/src/recognizer.ts Outdated Show resolved Hide resolved
@evidolob
Copy link
Collaborator Author

evidolob commented Jul 6, 2021

Hm, that strange, let me check

Signed-off-by: Yevhen Vydolob <yvydolob@redhat.com>
@evidolob
Copy link
Collaborator Author

evidolob commented Jul 6, 2021

@lstocchi It turndown that glob-gitignore is only supports of .gitignore rules but doesn't read it automatically, I just updated PR with reading .gitignore and pass it to glob-gitignore when we perform search.

Copy link
Collaborator

@lstocchi lstocchi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Member

@jeffmaury jeffmaury left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a partial implementation of .gitignore as it does only handle the root .gitignore

Maybe worth having .gitignore parsing and loading in a separate function

Unit test are welcomed

Signed-off-by: Yevhen Vydolob <yvydolob@redhat.com>
@evidolob evidolob merged commit 22440e9 into redhat-developer:main Jul 8, 2021
@evidolob evidolob deleted the use-glob-gitignore branch July 8, 2021 07:55
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants