You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This can pose a problem when components are moved from the gem to an individual application which is not uncommon (maybe the component used to be shared across different apps but is now being used by one app alone).
Because the Rubocop rules are stricter on the app level, it can force the developer to re-write some parts of the code completely, turning the simple operation of moving over some component files from govuk_publishing_components to any of the frontend apps into a real time sink.
Concrete example: most of the component helpers in the gem use instance variables. rubocop does not complain about this in the gem, but when you move the component from the gem to one of the frontend apps , rubocop raises a Rails/HelperInstanceVariable offense. Developer has to spend time reworking the component helper code to eliminate use of instance variables, which wouldn't need to happen if the code in the gem was written to the same standard as the code in the FE apps to begin with.
Should components gem rubocop be made stricter so that there is parity between the coding standards that are adhered to in the gem and the standards used in the other apps?
The text was updated successfully, but these errors were encountered:
I suppose this one's more of a question/prompt for discussion than a proper issue.
Rubocop configuration is different in the gem than it is on the frontend apps:
govuk_publishing_components
rubocop configgovernment-frontend
rubocop configThis can pose a problem when components are moved from the gem to an individual application which is not uncommon (maybe the component used to be shared across different apps but is now being used by one app alone).
Because the Rubocop rules are stricter on the app level, it can force the developer to re-write some parts of the code completely, turning the simple operation of moving over some component files from
govuk_publishing_components
to any of the frontend apps into a real time sink.Concrete example: most of the component helpers in the gem use instance variables.
rubocop
does not complain about this in the gem, but when you move the component from the gem to one of the frontend apps ,rubocop
raises aRails/HelperInstanceVariable
offense. Developer has to spend time reworking the component helper code to eliminate use of instance variables, which wouldn't need to happen if the code in the gem was written to the same standard as the code in the FE apps to begin with.Should components gem
rubocop
be made stricter so that there is parity between the coding standards that are adhered to in the gem and the standards used in the other apps?The text was updated successfully, but these errors were encountered: