phpinspectionsea icon indicating copy to clipboard operation
phpinspectionsea copied to clipboard

[Feature Request] Make Comparison Code Style Option Per Project

Open spenserhale opened this issue 7 years ago • 6 comments

First, thank you for reporting a bug or making a request. That takes time and we appreciate that!

Let's start with common details:

Subject Details
Issue type Feature request
Plugin Php Inspections (EA Ultimate)
Language level PHP 7.2

Current behaviour (description/screenshot:)

In Other Settings, Comparison code style You can choose between Regular comparison style or Yoda comparison style. This is at a user/ account level.

Expected behaviour

Ability to choose Regular or Yoda style per projects.

Notes

I work on both WordPress (Yoda Style) and Laravel (Regular Style) Projects on the same machine. Currently each time I switch projects, I have to change this setting.

spenserhale avatar Sep 24 '18 21:09 spenserhale

Do you store .idea/codeStyles in the project? CodeStyle can be configured per project. Just select a specific schema. Go to Settings -> Editor -> Code style -> Php and select proper schema.

https://www.jetbrains.com/help/idea/settings-code-style.html https://www.jetbrains.com/help/idea/configuring-code-style.html

funivan avatar Sep 25 '18 04:09 funivan

@funivan What do you mean by store code? Each project is in its own folder, and as separate PHPStorm projects, each with their own .idea folder.

spenserhale avatar Sep 25 '18 04:09 spenserhale

You need to create 2 different schemas. For example WP Code style and Laravel Code style. Then select the proper one for the project. And changing one schema - will not affect another. Then you can add a project schema to .git and all collaborators will have the same settings of the code style.

funivan avatar Sep 25 '18 04:09 funivan

@funivan: we don't utilize code style settings currently. This means our global settings wil be really annoying when jumping between projects with different CS.

kalessil avatar Sep 25 '18 05:09 kalessil

Oops. Sorry about that. I forgot that this configuration is moved from code style schema.

funivan avatar Sep 25 '18 06:09 funivan

@funivan no worries =) @spenserhale I'l target the next release for this feature, it seems to be in demand.

kalessil avatar Sep 25 '18 07:09 kalessil