Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Coding standards v3 #70

Merged
merged 18 commits into from
Jul 10, 2024
Merged

Coding standards v3 #70

merged 18 commits into from
Jul 10, 2024

Conversation

danepowell
Copy link
Collaborator

@danepowell danepowell commented Jul 1, 2024

The goal of v3 is to simplify and decouple the standards, as described in the readme:

  • Projects (e.g., Drupal modules) targeting the Drupal community should adopt a Drupal ruleset. This will no longer be based on AcquiaPHP, but on the Drupal standard. All others should adopt a general PHP ruleset, which will be based on PSR-12.
  • Public projects (e.g., open-source Drupal modules) should adopt a non-strict ruleset to facilitate external collaboration. Non-strict rulesets will be nearly identical to their base standards. All others should adopt a more opinionated internal/strict ruleset.

To do:

  • Should we rename these to match their intended audience (public/private projects) instead of describing the ruleset itself (strict/non-strict)?
  • Test on a representative set of projects to gauge the LOE for migration from v2

References:

Copy link
Contributor

@TravisCarden TravisCarden left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is great. I have some suggestions in the comments. I also have one concern related to stability:

Firstly

If we're including whole upstream rulesets indiscriminately (as opposed to rule-by-rule), we run the risk that upstream changes and additions will cause sudden, unexpected failures when projects update their dependencies.[1] We could pin to specific versions to avoid that, but then we expose our users to version conflicts. I wonder if we shouldn't do this:

  1. Literally copy the entire upstream rulesets into ours so that we can release breaking changes on our own schedule.
  2. Create separate "Edge" standards for Drupal and PHP and add new upstream rules there so that changes are completely predictable.
  3. Possibly create a CI job to detect upstream additions so we're sure to notice and add them.

Secondly

As to whether we should rename these to public/private, that's a different way of thinking about the whole distinction than we've used in the past. We previously implied that "Strict" was better if you could manage it, whereas now it seems like we're saying they're actually appropriate or inappropriate based on context. I'm fine with the shift, but public vs. private doesn't seem quite right to me. It seems more like open source vs. proprietary. This represents late developing on my part and conflicts with some of my comments on the actual code, but I think it might actually address some of the discomfort I was expressing there.


[1] Unless all of our upstream dependencies carefully observe Semver, which we can scarcely hope for, much less depend on.

README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
src/Standards/AcquiaDrupal/ruleset.xml Outdated Show resolved Hide resolved
src/Standards/AcquiaDrupal/ruleset.xml Outdated Show resolved Hide resolved
src/Standards/AcquiaEdge/ruleset.xml Outdated Show resolved Hide resolved
src/Standards/AcquiaPHP/ruleset.xml Outdated Show resolved Hide resolved
src/Standards/AcquiaPHPStrict/ruleset.xml Outdated Show resolved Hide resolved
@danepowell danepowell requested a review from TravisCarden July 9, 2024 19:02
Copy link
Contributor

@TravisCarden TravisCarden left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I found a few little things I went ahead and just fixed real quick. I'm happy with it now. Ship it! 🙂

@danepowell danepowell merged commit 619c135 into acquia:develop Jul 10, 2024
37 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants