Naming and the Style Guide


#1

According to the style guide (yes we have one: https://github.com/ManageIQ/ruby-style-guide), we have recommended formats for naming of classes and methods.

To confirm for my own understanding, I should be naming classes and instances in CamelCase, and methods in snake_case?

e.g.

Is there any plan to rename any of the in-built classes, instances or methods according to the guidelines for consistency?

pemcg


#2

“Classes and methods” in the ruby style guide refer to Ruby code in ManageIQ core. They are completely unrelated to “classes and methods” in Automate. However, I would think that some of the guidelines could also be followed for Automate methods, which are Ruby.

I don’t believe we have a “style” guide for Automate classes. Perhaps that’s something we may want to look into. @gmccullough @tinaafitz @mkanoor Thoughts?


#3

It sounds like a good idea, would this mean that the ae_types (variables, relationships, assertions, method connections) in the model should also follow the same convention. Internally the automate engine treats everything in ae_type fields as lowercase strings.
So if a relationship contained uppercase/lowercase/mixedcase connections they would all be treated the same.


#4

Yes, we’ve talked about automate model naming consistency and plan to rename the model classes, instances and methods. We discussed doing it this past release, but decided to wait since we already had so many model changes.


#5

Any response to this? It would be helpful to have a style guide for everything in automate. This will give birth to better consistency.


#6

Hi Ramrexx,

An automate style guide is a good idea.

Why don’t we start putting suggestions/guidelines here so we can see how it develops?

Our goal is to adhere to the automate model naming standard where:
Class names are CamelCased, and instance and method names are snake_cased.
We intend to modify the automate model to adhere to these standards.

Thanks,
Tina