diff --git a/.editorconfig b/.editorconfig index 8f0c87a10c53..163eb75c8525 100644 --- a/.editorconfig +++ b/.editorconfig @@ -1,3 +1,5 @@ +root = true + [*.cr] charset = utf-8 end_of_line = lf diff --git a/spec/compiler/crystal/tools/init_spec.cr b/spec/compiler/crystal/tools/init_spec.cr index 4678b68e000c..01e9c49e0be8 100644 --- a/spec/compiler/crystal/tools/init_spec.cr +++ b/spec/compiler/crystal/tools/init_spec.cr @@ -80,6 +80,7 @@ module Crystal {"example", "example_app", "example-lib", "camel_example-camel_lib"}.each do |name| describe_file "#{name}/.editorconfig" do |editorconfig| parsed = INI.parse(editorconfig) + parsed[""]["root"].should eq("true") cr_ext = parsed["*.cr"] cr_ext["charset"].should eq("utf-8") cr_ext["end_of_line"].should eq("lf") diff --git a/src/compiler/crystal/tools/init/template/editorconfig.ecr b/src/compiler/crystal/tools/init/template/editorconfig.ecr index 8f0c87a10c53..163eb75c8525 100644 --- a/src/compiler/crystal/tools/init/template/editorconfig.ecr +++ b/src/compiler/crystal/tools/init/template/editorconfig.ecr @@ -1,3 +1,5 @@ +root = true + [*.cr] charset = utf-8 end_of_line = lf