John Papa style guide cleanup

Registered by Cindy Lu on 2015-05-28

Summary:
Cleanup JS code with rules and refactor using John Papa's Angular Style Guide. Deprecate JSHint in the future.

Motivation:
We want to have clean, consistent code and rules. We want to eventually turn on some lint globally (https://review.openstack.org/#/c/186154/).

Description:
We are following the rules listed by John Papa here: https://github.com/johnpapa/angular-styleguide#jscs

UX:
No impact.

Outside Dependencies:
N/A

Requirements Update Required:

Doc Impact:

Blueprint information

Status:
Complete
Approver:
David Lyle
Priority:
High
Drafter:
Cindy Lu
Direction:
Approved
Assignee:
None
Definition:
Approved
Series goal:
Accepted for liberty
Implementation:
Implemented
Milestone target:
milestone icon 8.0.0
Started by
Travis Tripp on 2015-06-29
Completed by
David Lyle on 2015-08-19

Related branches

Sprints

Whiteboard

Gerrit topic: https://review.openstack.org/#q,topic:jscs/rules,n,z

Addressed by: https://review.openstack.org/185725
    Adding John Papa style guide to JSCS

Gerrit topic: https://review.openstack.org/#q,topic:bp/jscs-cleanup,n,z

Addressed by: https://review.openstack.org/186921
    JSCS Cleanup - Legacy JS files

Addressed by: https://review.openstack.org/187024
    JSCS cleanup - Angular framework widgets (partial)

Addressed by: https://review.openstack.org/187301
    JSCS Cleanup - Legacy JS test files

Addressed by: https://review.openstack.org/187758
    JSCS cleanup - Angular framework widgets (partial2)

Addressed by: https://review.openstack.org/187366
    JSCS cleanup - Angular framework widgets (partial)

Addressed by: https://review.openstack.org/187971
    JSCS Cleanup - o_d/static/

Addressed by: https://review.openstack.org/188316
    JSCS Cleanup - dashboard-app

Addressed by: https://review.openstack.org/188987
    JSCS cleanup - horizon/static/framework conf and util

Addressed by: https://review.openstack.org/188989
    JSCS cleanup - horizon/static/auth

Addressed by: https://review.openstack.org/188995
    JSCS Cleanup - style guide cleanup for action-list

Addressed by: https://review.openstack.org/188998
    JSCS cleanup - style guide cleanup for charts

Addressed by: https://review.openstack.org/188999
    JSCS cleanup - style guide cleanup for help-panel and MagicSearch

Addressed by: https://review.openstack.org/189074
    JSCS cleanup - style guide cleanup for metadata-display

Addressed by: https://review.openstack.org/189431
    JSCS cleanup - style guide cleanup for modal-wait-spinner

Addressed by: https://review.openstack.org/189460
    JSCS cleanup - style guide cleanup for modal

Addressed by: https://review.openstack.org/189524
    JSCS Cleanup - style guide cleanup for toast

Addressed by: https://review.openstack.org/189983
    JSCS Cleanup - style guide cleanup for wizard

Addressed by: https://review.openstack.org/190134
    JSCS Cleanup - karma.conf

Addressed by: https://review.openstack.org/190354
    JSCS cleanup - style guide cleanup for table and basic-table

Addressed by: https://review.openstack.org/190488
    JSCS cleanup - launch-instance/configuration/

Addressed by: https://review.openstack.org/190489
    JSCS cleanup - launch-instance/flavor/

Addressed by: https://review.openstack.org/190498
    JSCS cleanup - launch-instance/source/

Addressed by: https://review.openstack.org/190505
    JSCS cleanup - launch-instance/

Addressed by: https://review.openstack.org/190508
    JSCS cleanup - launch-instance/cloud-services/

Addressed by: https://review.openstack.org/191200
    JSCS Cleanup - style guide cleanup for transfer-table

Addressed by: https://review.openstack.org/191213
    JSCS Cleanup - Utils folder (partial)

Addressed by: https://review.openstack.org/192828
    JSCS Cleanup - style cleanup for Flavor Step

Addressed by: https://review.openstack.org/193267
    JSCS Cleanup - style cleanup for Launch Instance Configuration Step

Addressed by: https://review.openstack.org/193548
    JSCS Cleanup - style cleanup for Launch Instance Network Step

Addressed by: https://review.openstack.org/193608
    JSCS Cleanup - style cleanup for Launch Instance Security Groups Step

Addressed by: https://review.openstack.org/193658
    JSCS Cleanup - style guide cleanup for Keypair step

Addressed by: https://review.openstack.org/194306
    JSCS Cleanup - style cleanup for Launch Instance Source Step

Gerrit topic: https://review.openstack.org/#q,topic:better-format,n,z

Addressed by: https://review.openstack.org/194944
    JSCS cleanup - style guide cleanup for karma.config.js files

Addressed by: https://review.openstack.org/195660
    JSCS cleanup - openstack_dashboard/static/dashboard/workflow

Addressed by: https://review.openstack.org/192327
    Switched from JSCS to ESLint

Addressed by: https://review.openstack.org/195799
    Add selective ESLint rule activation for Horizon Legacy JS

Addressed by: https://review.openstack.org/196257
    Removed JSHint

Addressed by: https://review.openstack.org/196836
    JSCS Cleanup - style cleanup for modal factory

Addressed by: https://review.openstack.org/196881
    JSCS cleanup - launch-instance.js

Addressed by: https://review.openstack.org/197242
    JSCS Cleanup - style guide cleanup for Util > Bind Scope

Addressed by: https://review.openstack.org/197340
    JSCS Cleanup - rename *.factory.js to *.service.js

Gerrit topic: https://review.openstack.org/#q,topic:bp/angular-docs,n,z

Addressed by: https://review.openstack.org/198148
    Fix eslint errors on the login controller

Addressed by: https://review.openstack.org/198840
    Fix eslint errors about ng-di on the cloud-services.

Addressed by: https://review.openstack.org/198844
    Use angular.isUndefined in place of !angular.isDefined

Addressed by: https://review.openstack.org/198870
    JSCS - making app.module.js following JP

Addressed by: https://review.openstack.org/199220
    Ignore the ng_on_watch error from eslint

Addressed by: https://review.openstack.org/199223
    Change this to be set to 'vm' instead of 'ctrl' for soure.controller and source-help.controller

Addressed by: https://review.openstack.org/199248
    Change a comparison with 'undefined' to use angular.isUndefined()

Addressed by: https://review.openstack.org/199327
    Use angular.isDefined/isUndefined instead of comparing to keyword 'undefined'.

Addressed by: https://review.openstack.org/199333
    Disable angular/ng_window_service on the service-api specs

Addressed by: https://review.openstack.org/199345
    JSCS Cleanup - horizon/ tech-debt

Addressed by: https://review.openstack.org/199789
    fix a couple lint errors in filters.js

Addressed by: https://review.openstack.org/200297
    Ignore the ESLINT controller as VM rule

Addressed by: https://review.openstack.org/200327
    Addresses camelcase variable names and exceeded max-length violations

Addressed by: https://review.openstack.org/200648
    JSCS Cleanup - use DI in launch instance model

Addressed by: https://review.openstack.org/200725
    Fix eslint error on framework.module.

Addressed by: https://review.openstack.org/200752
    Fix eslint for the metadata-tree widgets.

Addressed by: https://review.openstack.org/200760
    JSCS Cleanup - use DI in launch instance model

Addressed by: https://review.openstack.org/200763
    Addresses use of digest in launch-instance specs by using apply instead

Addressed by: https://review.openstack.org/201027
    JSCS Cleanup - Include angular rules in eslint

Addressed by: https://review.openstack.org/201032
    JSCS Cleanup - rename vm as ctrl for login controller

Addressed by: https://review.openstack.org/201289
    JSCS Cleanup - use $apply instead of $digest for action-list.spec

Addressed by: https://review.openstack.org/201359
    JSCS Cleanup - Fix eslint errors in flavor

Addressed by: https://review.openstack.org/201363
    JSCS Cleanup - Fix eslint errors in source spec file

Addressed by: https://review.openstack.org/201374
    JSCS Cleanup - Fix eslint errors in workflow file

Addressed by: https://review.openstack.org/201688
    JSCS Cleanup - use function syntax for i18n

Addressed by: https://review.openstack.org/201689
    JSCS Cleanup - use $apply instead of $digest in help-panel spec

Addressed by: https://review.openstack.org/202204
    Fix eslint errors for hz.dashboard.identity

Gerrit topic: https://review.openstack.org/#q,topic:bp/angularize-metadata-update-modals,n,z

Addressed by: https://review.openstack.org/203795
    JSCS Cleanup - Metadata widgets cleanup

Addressed by: https://review.openstack.org/204298
    JSCS Cleanup - horizon widgets for transfer-table

Addressed by: https://review.openstack.org/204306
    JSCS Cleanup - horizon widgets for charts

Addressed by: https://review.openstack.org/204317
    JSCS Cleanup - horizon widgets for modal-wait-spinner

Addressed by: https://review.openstack.org/205104
    JSCS/eslint cleanup - o_s/tech-debt, bind-scope, toast

Addressed by: https://review.openstack.org/207549
    JSCS Cleanup - move functions humanize and truncate

Addressed by: https://review.openstack.org/207714
    JSCS Cleanup - style guide cleanup for configuration step

Addressed by: https://review.openstack.org/207720
    JSCS Cleanup - style guide cleanup for Flavor step

Addressed by: https://review.openstack.org/208312
    JSCS Cleanup - style guide cleanup for source step

Addressed by: https://review.openstack.org/208314
    JSCS Cleanup - style guide cleanup for security-groups step

Addressed by: https://review.openstack.org/208316
    JSCS Cleanup - style guide cleanup for Launch Instance wizard

Gerrit topic: https://review.openstack.org/#q,topic:bug/1481135,n,z

Addressed by: https://review.openstack.org/209106
    JSCS cleanup - eslint cleanup for openstack-service-api

Gerrit topic: https://review.openstack.org/#q,topic:launch_di,n,z

Addressed by: https://review.openstack.org/211741
    JSCS Cleanup - use DI in launch instance model

Addressed by: https://review.openstack.org/212308
    Move magic_search.js in _scripts.html to after Angular files

Gerrit topic: https://review.openstack.org/#q,topic:bp/john-papa-style-guide,n,z

Addressed by: https://review.openstack.org/212838
    Use the JP Style Guide for OpenStack Services

Addressed by: https://review.openstack.org/213818
    Upgraded eslint-config-openstack

Gerrit topic: https://review.openstack.org/#q,topic:bug/1485885,n,z

Gerrit topic: https://review.openstack.org/#q,topic:bp/ng-metadata-defs-panel,n,z

Addressed by: https://review.openstack.org/217922
    JSCS Cleanup - use DI in launch instance model

Addressed by: https://review.openstack.org/220590
    Fix eslint errors

Gerrit topic: https://review.openstack.org/#q,topic:bug/1496627,n,z

Addressed by: https://review.openstack.org/224895
    Fix lint errors for horizon.networktopology.js

(?)

Work Items

This blueprint contains Public information 
Everyone can see this information.

Subscribers

No subscribers.