kalessil / phpinspectionsea

A Static Code Analyzer for PHP (a PhpStorm/Idea Plugin)
https://plugins.jetbrains.com/plugin/7622?pr=phpStorm
Other
1.44k stars 118 forks source link

[Feature Request] Make Comparison Code Style Option Per Project #1040

Open spenserhale opened 6 years ago

spenserhale commented 6 years ago

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.

funivan commented 6 years ago

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

spenserhale commented 6 years ago

@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.

funivan commented 6 years ago

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.

kalessil commented 6 years ago

@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.

funivan commented 6 years ago

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

kalessil commented 6 years ago

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