Haehnchen / idea-php-symfony2-plugin

IntelliJ IDEA / PhpStorm Symfony Plugin
https://plugins.jetbrains.com/plugin/7219
MIT License
910 stars 138 forks source link

Ignore .lando.yml file #1319

Open gogowitsch opened 5 years ago

gogowitsch commented 5 years ago

This plugin is confused because .lando.yml files may contain a top-level key services:. It says "Missing argument", when in fact all is fine.

These files are not meant for Symfony at all. For example, in the Drupal 8 ecosystem, both Lando and Symfony can coexist without any problems.

For documentation, see https://docs.devwithlando.io.

ruudk commented 4 years ago

I checked the code, and we can add a special exclusion here: https://github.com/Haehnchen/idea-php-symfony2-plugin/blob/e6919b9b8a035b3e96bb3ee0fc7aec472455876f/src/main/java/fr/adrienbrault/idea/symfony2plugin/intentions/yaml/YamlServiceArgumentInspection.java#L52-L56

if(file.getOriginalFile().getName().equals(".lando.yml")) {
    return;
}

But where does it end. Somebody else will come along and also wants to exclude a special file.

@Haehnchen wdyt?

King2500 commented 4 years ago

Symfony Service definitions should only match to config/**services**.yml (including folders like config/services/a.yml) Does that exclude .lando.yml? Where is that located?

King2500 commented 4 years ago

Maybe we could exclude .*.yml and .*.yaml (ie. files starting with .) ?

gogowitsch commented 4 years ago

@King2500 The .lando.yml is never within a folder called config, but typically located at the root of the repository.

Contrary to your observation, there is not always a config directory. See for example the automated_cron.services.yml from Drupal 8.