Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Possible to ignore/exclude file/folder from .editorconfig?

Tags:

editorconfig

Is it possible to ignore/exclude file/folder from .editorconfig?

Reason: I have a /vendor folder with third party files. I don't want the folder to inherit any of my .editorconfig configs.

I found the EditorConfig-Properties page and seems like there's no property to exclude folders. Maybe there's a hack to make it possible?

current config

root = true

[*]
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
indent_style = tab
like image 232
iDev247 Avatar asked May 18 '15 18:05

iDev247


People also ask

How do I exclude files from a folder?

Under Virus & threat protection settings, select Manage settings, and then under Exclusions, select Add or remove exclusions. Select Add an exclusion, and then select from files, folders, file types, or process. A folder exclusion will apply to all subfolders within the folder as well.

How to disable EditorConfig?

Disable EditorConfig supportPress Ctrl+Alt+S to open the IDE settings and select Editor | Code Style. Clear the Enable EditorConfig support checkbox. Apply the changes and close the dialog.

How does EditorConfig work?

The EditorConfig project consists of a file format for defining coding styles and a collection of text editor plugins that enable editors to read the file format and adhere to defined styles. EditorConfig files are easily readable and they work nicely with version control systems.

Where to place EditorConfig file?

editorconfig file at the root of your repo or in the directory that your project resides. Visual Studio looks for a file named . editorconfig in the directory of the opened file and in every parent directory.


3 Answers

Another solution to ignore /vendor folder:

  • match the path you want to ignore
  • set unset to property you want to ignore

For example, if you have:

  • /index.html
  • /vendor
  • /.editorconfig

You can match all files in the vendor directory in your .editorconfig and ignore all properties (set to IDE's default):

# top-most EditorConfig file root = true  # Ignore paths [/vendor/**] charset = unset end_of_line = unset insert_final_newline = unset trim_trailing_whitespace = unset indent_style = unset indent_size = unset 
like image 115
Danail Avatar answered Sep 24 '22 12:09

Danail


You can create an .editorconfig file in vender/ with a simple root = true line.

like image 22
xuhdev Avatar answered Sep 22 '22 12:09

xuhdev


Best way I've found is to add this to an otherwise blank .editorconfig in the folder you want to ignore:

[*]
generated_code = true
like image 22
kzu Avatar answered Sep 22 '22 12:09

kzu