[D7] Coding standards

Created on 15 May 2020, about 4 years ago
Updated 16 February 2024, 4 months ago

Note this only applies to Fivestar in Drupal 7. For Drupal 8, see #3133101: [D8] Coding standards →

Fivestar 7.x-2.x was written under a previous set of coding standards - Drupal core has changed standards drastically since then, with many new standards aimed primarily at D8 code. Drupal core policy → is this:

All new code should follow the current standards, regardless of (core) version. Existing code in older versions may be updated, but doesn't necessarily have to be. Especially for larger code-bases (like Drupal core), updating the code of a previous version for the current standards may be too huge of a task. However, code in current versions should follow the current standards.

There are more reasons than just "may be too huge of a task" to leave the 7.x-2.x code mostly untouched - modifying class names, variable names, etc. has a great potential to break code and break our integration with modules like Views. Likewise, coding standards patches touch many parts of the code base, so have a great potential to break other work-in-progress patches that address real problems (bug reports) or make real improvements (feature requests) - coding standards changes are extremely minor in importance related to these.

Because of this, I am not very interested in putting in a lot of effort to change anything EXCEPT for things that may / are known to cause problems (like extra whitespace or missing EOL at ends of files) and things that will actually HELP people who use Fivestar (like missing or incomplete documentation comments).

If you would like to submit patches here, make sure they are restricted to one and only one type of standards violation - that will make them easier to review. We don't need multiple issues for this - all coding standards patches should be posted in this issue.

📌 Task
Status

Needs work

Version

2.0

Component

Code

Created by

🇺🇸United States TR Cascadia

Live updates comments and jobs are added and updated live.
  • Coding standards

    It involves compliance with, or the content of coding standards. Requires broad community agreement.

Sign in to follow issues

Merge Requests

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.69.0 2024