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

Style guide: Add conventions for formatting angular module/function declarations #1121

Closed
jawnsy opened this issue Jan 16, 2017 · 4 comments
Closed
Assignees
Labels
area/techdebt lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. priority/P3

Comments

@jawnsy
Copy link

jawnsy commented Jan 16, 2017

Please add something to the style guide about formatting for angular.module declarations. For example:

directives/buildPipeline.js:

angular.module('openshiftConsole')
  .directive('buildPipeline', function($filter, Logger) {

angular.module on same line?

directives/actionChip.js:

angular
  .module('openshiftConsole')
  .directive('actionChip', function() {

.module (or other method calls) on their own line, indented, below angular

directives/deploymentMetrics.js:

angular.module('openshiftConsole')
  .directive('deploymentMetrics', function($interval,
                                           $parse,
                                           $timeout,
                                           $q,
                                           $rootScope,
                                           ChartsService,
                                           ConversionService,
                                           MetricsCharts,
                                           MetricsService,
                                           ModalsService) {

imports aligned to function call, to the right of directive declaration.

directives/labels.js:

angular.module('openshiftConsole')
  .directive('labels', function($location, $timeout, LabelFilter) {

imports directly inline, not wrapped.

controllers/attachPVC.js:

angular.module('openshiftConsole')
  .controller('AttachPVCController',
              function($filter,
                       $routeParams,
                       $scope,
                       $window,
                       APIService,
                       AuthorizationService,
                       BreadcrumbsService,
                       DataService,
                       Navigate,
                       ProjectsService,
                       StorageService) {

imports below the controller name, function declaration aligned to controller name

@spadgett
Copy link
Member

spadgett commented Feb 1, 2017

Related to this, I think we should leave off ngdoc comments above these declarations when they have no meaningful descriptions. We have a lot of these copied throughout the code, and some don't even have the right controller names (see #1204).

@benjaminapetersen
Copy link
Contributor

agree!

@openshift-bot
Copy link

Issues go stale after 90d of inactivity.

Mark the issue as fresh by commenting /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.
Exclude this issue from closing by commenting /lifecycle frozen.

If this issue is safe to close now please do so with /close.

/lifecycle stale

@openshift-ci-robot openshift-ci-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Aug 9, 2020
@spadgett
Copy link
Member

Closing as 3.x is in maintenance only mode. In 4.x, we use prettier.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/techdebt lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. priority/P3
Projects
None yet
Development

No branches or pull requests

6 participants