jeremiah-c-leary / vhdl-style-guide

Style guide enforcement for VHDL
GNU General Public License v3.0
177 stars 38 forks source link

How to change default indentation from 2 spaces to 3 spaces ? #1095

Closed MJoergen closed 6 months ago

MJoergen commented 6 months ago

The default indent_size seems to be 2. I would like to change the desired indent_size to 3.

I've tried using this in the configuration file, but it doesn't work.

rule:
  global:
    indent_style : 'spaces'
    indent_size  : 3

The expected behavior is that a source file that currently has an indentation of 2 spaces will be changed to having 3 spaces at each indentation. However, the observed behavior is that the source file is unchanged, i.e. still has only 2 spaces of indentation.

My complete configuration file is here (file extension changed from .yml to .txt, apparently required by GitHub) vsg.txt

JHertz5 commented 6 months ago

Hi @MJoergen. I think I know why your configuration file isn't working. The properties are not called indent_style and indent_size, they are called indentStyle and indentSize. You will see that if you run vsg -rc <rule_name>, the output should contain

...
      "indentStyle": "spaces",
      "indentSize": 2,
...

If you try the following config, you should have better results:

rule:
  global:
    indentStyle: 'spaces'
    indentSize: 3

This mistake is easy to make, given that all, or at least the vast majority, of the properties of rules are snake_case rather than camelCase. Perhaps it is worth raising an issue to correct this inconsistency.

MJoergen commented 6 months ago

Thank you @JHertz5 .