monokle icon indicating copy to clipboard operation
monokle copied to clipboard

Use .gitignore to ignore files

Open olensmar opened this issue 1 year ago • 8 comments

Suggest to add a global setting for using .gitignore to ignore files - default to true - should be straight-forward using https://github.com/kaelzhang/node-ignore.

Alternatively we could have a list of ignore files that Monokle uses (similar to exclusion lists) - default to .gitignore and .monokleignore !?

relates to #3089 and #2260

olensmar avatar May 12 '23 06:05 olensmar

Let's check if that will impact our capabilities for previews (i.e. is there any best practice that keeps values.yaml files out of source control). If that doesn't happen, I think this makes sense.

chargio avatar May 16 '23 07:05 chargio

Interested to make one if required. Do mention what should be "ignored".

ronitblenz avatar May 27 '23 10:05 ronitblenz

Hi @ronitblenz - we would ignore anything found in a .gitignore file - the library mentioned in the description should be sufficient to support this

olensmar avatar May 29 '23 07:05 olensmar

@olensmar If needed, I can create one. If not let it be the way it is. What do you think?

ronitblenz avatar May 29 '23 10:05 ronitblenz

@ronitblenz let's use the aforementioned library for this - no need to create/maintain our own..

olensmar avatar May 29 '23 11:05 olensmar

Great! So, is it already implemented or we have to?

ronitblenz avatar May 29 '23 11:05 ronitblenz

you should be able to use https://github.com/kaelzhang/node-ignore to decide on which files to include/ignore when processing.

This feature will be consider done when:

  • There is a global setting in the Settings panel named "Use .gitignore files", which is selected by default
  • There is a similar project setting which defaults to the global setting
  • When selected and a .gitignore file is found in the current root folder, the ignores in that file are applied to the resource processing and in the file explorer (i.e. ignored files/folders are grayed out)
  • If the user changes this setting at the project level, they should be prompted to reload their project if the project contains a .gitignore file in its root folder

olensmar avatar May 29 '23 11:05 olensmar

Ok... lets try it! Making a PR if done

ronitblenz avatar May 29 '23 13:05 ronitblenz