Skip to content

Commit

Permalink
Fixes oppia#7010: Adds a linting check that ensures all TODO comments…
Browse files Browse the repository at this point in the history
… have a username with them (oppia#7114)

* Add linting function to check that TODO comments have a user

* Fix regex to match digits present in usernames

* Put the bad regex for todo comments in the global variables for TS, JS, and PY files

* Add regex to HTML bad patterns, and fix TODO comments with the codeowner of the file

* Remove unnecessary comment

* Shorten line lengths in comments

* Add a user to a TODO comment in the jobs.py file

* Fix TODO comment in extensions

* Enforce the @ sign in TODO comments over the whole project

* Delete files that had been deleted in develop

* Change lowercase todo to uppercase TODO in pre_commit_linter

* Checkout the package-lock file to develop branch

* Fix package-lock.json file

* Force package-lock.json to be develop version

* Update TODO comment format in a few new locations

* Revert regexp to omitting @ sign

* Fix TODO assignments

* Add a message for sean's todo

* Put the TODO regexp in its own structure, and enforce : and message

* Fix more TODO comment formats

* Remove unnecessary + sign from message
  • Loading branch information
teddymarchildon authored and seanlip committed Jul 23, 2019
1 parent 6d2e9e5 commit d89d68f
Show file tree
Hide file tree
Showing 132 changed files with 235 additions and 215 deletions.
4 changes: 2 additions & 2 deletions core/controllers/reader.py
Original file line number Diff line number Diff line change
Expand Up @@ -926,8 +926,8 @@ class RecommendationsHandler(base.BaseHandler):
if there are upcoming explorations for the learner to complete.
"""

# TODO(bhenning): Move the recommendation selection logic & related tests to
# the domain layer as service methods or to the frontend to reduce the
# TODO(bhenning): Move the recommendation selection logic & related tests
# to the domain layer as service methods or to the frontend to reduce the
# amount of logic needed in this handler.

GET_HANDLER_ERROR_RETURN_TYPE = feconf.HANDLER_TYPE_JSON
Expand Down
4 changes: 2 additions & 2 deletions core/domain/collection_services_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@


# TODO(bhenning): test CollectionSummaryModel changes if collections are
# updated, reverted, deleted, created, rights changed. See TODO at the top of
# exp_services_test for more original context.
# updated, reverted, deleted, created, rights changed. See TODO(msl): at
# the top of exp_services_test for more original context.

# pylint: disable=protected-access
def _count_at_least_editable_collection_summaries(user_id):
Expand Down
2 changes: 1 addition & 1 deletion core/domain/exp_services_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -3026,7 +3026,7 @@ def test_get_next_page_of_all_non_private_commits(self):
self.assertDictContainsSubset(
self.COMMIT_ALBERT_PUBLISH_EXP_2, commit_dicts[0])

# TODO(frederikcreemers@gmail.com) test max_age here.
# TODO(frederikcreemers@gmail.com): test max_age here.


class ExplorationSearchTests(ExplorationServicesUnitTests):
Expand Down
2 changes: 1 addition & 1 deletion core/domain/feedback_services.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
DEFAULT_SUGGESTION_THREAD_INITIAL_MESSAGE = ''


# TODO (nithesh): Once feedback threads are generalised, the below function
# TODO(nithesh): Once feedback threads are generalised, the below function
# needs to be edited to get id of a general entity. For the moment, the
# function will return the exploration_id from a thread_id.
def get_exp_id_from_thread_id(thread_id):
Expand Down
5 changes: 3 additions & 2 deletions core/domain/story_services_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -1355,8 +1355,9 @@ def test_record_completed_node_in_story_context(self):
self.NODE_ID_1, self.NODE_ID_2, self.NODE_ID_3])


# TODO: Remove this mock class and the StoryContentsMigrationTests class
# once the actual functions for story_contents migrations are implemented.
# TODO(aks681): Remove this mock class and the StoryContentsMigrationTests
# class once the actual functions for story_contents migrations are
# implemented.
class MockStoryObject(story_domain.Story):
"""Mocks Story domain object."""

Expand Down
3 changes: 2 additions & 1 deletion core/jobs.py
Original file line number Diff line number Diff line change
Expand Up @@ -1012,7 +1012,8 @@ def validate(cls, unused_mapper_spec):
Returns:
bool. Whether mapper spec and all mapper patterns are valid.
"""
return True # TODO.
# TODO(seanlip): Actually implement the validation.
return True


class BaseMapReduceJobManagerForContinuousComputations(BaseMapReduceJobManager):
Expand Down
2 changes: 1 addition & 1 deletion core/storage/user/gae_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class UserSettingsModel(base_models.BaseModel):
email = ndb.StringProperty(required=True, indexed=True)
# User role. Required for authorization. User gets a default role of
# exploration editor.
# TODO (1995YogeshSharma): Remove the default value once the one-off
# TODO(1995YogeshSharma): Remove the default value once the one-off
# migration (to give role to all users) is run.
role = ndb.StringProperty(
required=True, indexed=True, default=feconf.ROLE_ID_EXPLORATION_EDITOR)
Expand Down
2 changes: 1 addition & 1 deletion core/templates/dev/head/AppSpec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
* @fileoverview Unit tests for generic services.
*/

// TODO(YashJipkate) Remove the following block of unnnecessary imports once
// TODO(YashJipkate): Remove the following block of unnnecessary imports once
// App.ts is upgraded to Angular 8.
import { RuleObjectFactory } from 'domain/exploration/RuleObjectFactory.ts';
import { WrittenTranslationObjectFactory } from
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
* @fileoverview Unit tests for the question player state service.
*/

// TODO(YashJipkate) Remove the following block of unnnecessary imports once
// TODO(YashJipkate): Remove the following block of unnnecessary imports once
// question-player-state.service.ts is upgraded to Angular 8.
import { RuleObjectFactory } from 'domain/exploration/RuleObjectFactory.ts';
import { WrittenTranslationObjectFactory } from
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
* editor page.
*/

// TODO(YashJipkate) Remove the following block of unnnecessary imports once
// TODO(YashJipkate): Remove the following block of unnnecessary imports once
// state-property.service.ts is upgraded to Angular 8.
import { ExplorationDraftObjectFactory } from
'domain/exploration/ExplorationDraftObjectFactory.ts';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
* @fileoverview Unit tests for the controller of 'State Interactions'.
*/

// TODO(YashJipkate) Remove the following block of unnnecessary imports once
// TODO(YashJipkate): Remove the following block of unnnecessary imports once
// state-interaction-editor.directive.ts is upgraded to Angular 8.
import { ExplorationFeaturesService } from
'services/ExplorationFeaturesService.ts';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,9 @@ oppia.factory('CollectionNodeObjectFactory', [
// object are not reflected in this domain object. The value returned by
// this function is null if doesExplorationExist() returns false.
CollectionNode.prototype.getExplorationSummaryObject = function() {
// TODO(bhenning): This should be represented by a frontend summary domain
// object that is also shared with the search result and profile pages.
// TODO(bhenning): This should be represented by a
// frontend summary domain object that is also shared with
// the search result and profile pages.
return angular.copy(this._explorationSummaryObject);
};

Expand All @@ -91,7 +92,7 @@ oppia.factory('CollectionNodeObjectFactory', [
// Static class methods. Note that "this" is not available in static
// contexts. This function takes a JSON object which represents a backend
// collection node python dict.
// TODO (ankita240796) Remove the bracket notation once Angular2 gets in.
// TODO(ankita240796): Remove the bracket notation once Angular2 gets in.
/* eslint-disable dot-notation */
CollectionNode['create'] = function(collectionNodeBackendObject) {
/* eslint-enable dot-notation */
Expand All @@ -100,11 +101,11 @@ oppia.factory('CollectionNodeObjectFactory', [

// TODO(bhenning): Ensure this matches the backend dict elements for
// collection nodes.
// TODO (ankita240796) Remove the bracket notation once Angular2 gets in.
// TODO(ankita240796): Remove the bracket notation once Angular2 gets in.
/* eslint-disable dot-notation */
CollectionNode['createFromExplorationId'] = function(explorationId) {
/* eslint-enable dot-notation */
// TODO (ankita240796) Remove the bracket notation once Angular2
// TODO(ankita240796): Remove the bracket notation once Angular2
// gets in.
/* eslint-disable dot-notation */
return CollectionNode['create']({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ oppia.factory('CollectionObjectFactory', [
// Static class methods. Note that "this" is not available in static
// contexts. This function takes a JSON object which represents a backend
// collection python dict.
// TODO (ankita240796) Remove the bracket notation once Angular2 gets in.
// TODO(ankita240796): Remove the bracket notation once Angular2 gets in.
/* eslint-disable dot-notation */
Collection['create'] = function(collectionBackendObject) {
/* eslint-enable dot-notation */
Expand All @@ -250,7 +250,7 @@ oppia.factory('CollectionObjectFactory', [

// Create a new, empty collection. This is not guaranteed to pass validation
// tests.
// TODO (ankita240796) Remove the bracket notation once Angular2 gets in.
// TODO(ankita240796): Remove the bracket notation once Angular2 gets in.
/* eslint-disable dot-notation */
Collection['createEmptyCollection'] = function() {
/* eslint-enable dot-notation */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ oppia.factory('CollectionPlaythroughObjectFactory', [function() {
return 1;
};

// TODO (ankita240796) Remove the bracket notation once Angular2 gets in.
// TODO(ankita240796): Remove the bracket notation once Angular2 gets in.
/* eslint-disable dot-notation */
CollectionPlaythrough['hasFinishedCollection'] = function() {
/* eslint-enable dot-notation */
Expand All @@ -72,7 +72,7 @@ oppia.factory('CollectionPlaythroughObjectFactory', [function() {
// Static class methods. Note that "this" is not available in static
// contexts. This function takes a JSON object which represents a backend
// collection playthrough python dict.
// TODO (ankita240796) Remove the bracket notation once Angular2 gets in.
// TODO(ankita240796): Remove the bracket notation once Angular2 gets in.
/* eslint-disable dot-notation */
CollectionPlaythrough['createFromBackendObject'] = function(
/* eslint-enable dot-notation */
Expand All @@ -82,7 +82,7 @@ oppia.factory('CollectionPlaythroughObjectFactory', [function() {
collectionPlaythroughBackendObject.completed_exploration_ids);
};

// TODO (ankita240796) Remove the bracket notation once Angular2 gets in.
// TODO(ankita240796): Remove the bracket notation once Angular2 gets in.
/* eslint-disable dot-notation */
CollectionPlaythrough['create'] = function(
/* eslint-enable dot-notation */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ oppia.factory('CollectionRightsObjectFactory', [
// Static class methods. Note that "this" is not available in static
// contexts. This function takes a JSON object which represents a backend
// collection python dict.
// TODO (ankita240796) Remove the bracket notation once Angular2 gets in.
// TODO(ankita240796): Remove the bracket notation once Angular2 gets in.
/* eslint-disable dot-notation */
CollectionRights['create'] = function(collectionRightsBackendObject) {
/* eslint-enable dot-notation */
Expand All @@ -116,7 +116,7 @@ oppia.factory('CollectionRightsObjectFactory', [

// Create a new, empty collection rights object. This is not guaranteed to
// pass validation tests.
// TODO (ankita240796) Remove the bracket notation once Angular2 gets in.
// TODO(ankita240796): Remove the bracket notation once Angular2 gets in.
/* eslint-disable dot-notation */
CollectionRights['createEmptyCollectionRights'] = function() {
/* eslint-enable dot-notation */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ oppia.factory('GuestCollectionProgressObjectFactory', [
// object and returns a new GuestCollectionProgress domain object. A null or
// undefined string indicates that an empty progress object should be
// created.
// TODO (ankita240796) Remove the bracket notation once Angular2 gets in.
// TODO(ankita240796): Remove the bracket notation once Angular2 gets in.
/* eslint-disable dot-notation */
GuestCollectionProgress['createFromJson'] = function(
/* eslint-enable dot-notation */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ oppia.factory('BaseUndoRedoService', [
_dispatchMutation();
};

// TODO (ankita240796) Remove the bracket notation once Angular2 gets in.
// TODO(ankita240796): Remove the bracket notation once Angular2 gets in.
/* eslint-disable dot-notation */
BaseUndoRedoService['init'] = function() {
/* eslint-enable dot-notation */
Expand All @@ -60,7 +60,7 @@ oppia.factory('BaseUndoRedoService', [
* are lost and cannot be redone. This will fire an event as defined by the
* constant EVENT_UNDO_REDO_SERVICE_CHANGE_APPLIED.
*/
// TODO (ankita240796) Remove the bracket notation once Angular2 gets in.
// TODO(ankita240796): Remove the bracket notation once Angular2 gets in.
/* eslint-disable dot-notation */
BaseUndoRedoService['applyChange'] = function(changeObject, domainObject) {
/* eslint-enable dot-notation */
Expand All @@ -75,7 +75,7 @@ oppia.factory('BaseUndoRedoService', [
* will fire an event as defined by the constant
* EVENT_UNDO_REDO_SERVICE_CHANGE_APPLIED.
*/
// TODO (ankita240796) Remove the bracket notation once Angular2 gets in.
// TODO(ankita240796): Remove the bracket notation once Angular2 gets in.
/* eslint-disable dot-notation */
BaseUndoRedoService['undoChange'] = function(domainObject) {
/* eslint-enable dot-notation */
Expand All @@ -93,7 +93,7 @@ oppia.factory('BaseUndoRedoService', [
* if there are no changes to redo, and true if otherwise. This will fire an
* event as defined by the constant EVENT_UNDO_REDO_SERVICE_CHANGE_APPLIED.
*/
// TODO (ankita240796) Remove the bracket notation once Angular2 gets in.
// TODO(ankita240796): Remove the bracket notation once Angular2 gets in.
/* eslint-disable dot-notation */
BaseUndoRedoService['redoChange'] = function(domainObject) {
/* eslint-enable dot-notation */
Expand All @@ -111,7 +111,7 @@ oppia.factory('BaseUndoRedoService', [
* object. This list will not contain undone actions. Changes to the
* returned list will not be reflected in this service.
*/
// TODO (ankita240796) Remove the bracket notation once Angular2 gets in.
// TODO(ankita240796): Remove the bracket notation once Angular2 gets in.
/* eslint-disable dot-notation */
BaseUndoRedoService['getChangeList'] = function() {
/* eslint-enable dot-notation */
Expand All @@ -126,7 +126,7 @@ oppia.factory('BaseUndoRedoService', [
* this service. Changes to the returned list will not affect this service.
* Furthermore, the returned list is ready to be sent to the backend.
*/
// TODO (ankita240796) Remove the bracket notation once Angular2 gets in.
// TODO(ankita240796): Remove the bracket notation once Angular2 gets in.
/* eslint-disable dot-notation */
BaseUndoRedoService['getCommittableChangeList'] = function() {
/* eslint-enable dot-notation */
Expand All @@ -138,7 +138,7 @@ oppia.factory('BaseUndoRedoService', [
return committableChangeList;
};

// TODO (ankita240796) Remove the bracket notation once Angular2 gets in.
// TODO(ankita240796): Remove the bracket notation once Angular2 gets in.
/* eslint-disable dot-notation */
BaseUndoRedoService['setChangeList'] = function(changeList) {
/* eslint-enable dot-notation */
Expand All @@ -149,7 +149,7 @@ oppia.factory('BaseUndoRedoService', [
* Returns the number of changes that have been applied to the domain
* object.
*/
// TODO (ankita240796) Remove the bracket notation once Angular2 gets in.
// TODO(ankita240796): Remove the bracket notation once Angular2 gets in.
/* eslint-disable dot-notation */
BaseUndoRedoService['getChangeCount'] = function() {
/* eslint-enable dot-notation */
Expand All @@ -159,7 +159,7 @@ oppia.factory('BaseUndoRedoService', [
/**
* Returns whether this service has any applied changes.
*/
// TODO (ankita240796) Remove the bracket notation once Angular2 gets in.
// TODO(ankita240796): Remove the bracket notation once Angular2 gets in.
/* eslint-disable dot-notation */
BaseUndoRedoService['hasChanges'] = function() {
/* eslint-enable dot-notation */
Expand All @@ -171,7 +171,7 @@ oppia.factory('BaseUndoRedoService', [
* applied from applyChange() or redoChange(). This will fire an event as
* defined by the constant EVENT_UNDO_REDO_SERVICE_CHANGE_APPLIED.
*/
// TODO (ankita240796) Remove the bracket notation once Angular2 gets in.
// TODO(ankita240796): Remove the bracket notation once Angular2 gets in.
/* eslint-disable dot-notation */
BaseUndoRedoService['clearChanges'] = function() {
/* eslint-enable dot-notation */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ oppia.factory('ChangeObjectFactory', [function() {
// parameter is a callback which behaves in the same way as the second
// parameter and takes the same inputs, except it should reverse the change
// for the provided domain object.
// TODO (ankita240796) Remove the bracket notation once Angular2 gets in.
// TODO(ankita240796): Remove the bracket notation once Angular2 gets in.
/* eslint-disable dot-notation */
Change['create'] = function(
/* eslint-enable dot-notation */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ oppia.factory('AnswerGroupObjectFactory', [

// Static class methods. Note that "this" is not available in
// static contexts.
// TODO (ankita240796) Remove the bracket notation once Angular2 gets in.
// TODO(ankita240796): Remove the bracket notation once Angular2 gets in.
/* eslint-disable dot-notation */
AnswerGroup['createNew'] = function(
/* eslint-enable dot-notation */
Expand All @@ -55,7 +55,7 @@ oppia.factory('AnswerGroupObjectFactory', [
rules, outcome, trainingData, taggedMisconceptionId);
};

// TODO (ankita240796) Remove the bracket notation once Angular2 gets in.
// TODO(ankita240796): Remove the bracket notation once Angular2 gets in.
/* eslint-disable dot-notation */
AnswerGroup['createFromBackendDict'] = function(answerGroupBackendDict) {
/* eslint-enable dot-notation */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ oppia.factory('AnswerStatsObjectFactory', [function() {
* @param {{answer, frequency: number}} backendDict
* @returns {AnswerStats}
*/
// TODO (ankita240796) Remove the bracket notation once Angular2 gets in.
// TODO(ankita240796): Remove the bracket notation once Angular2 gets in.
/* eslint-disable dot-notation */
AnswerStats['createFromBackendDict'] = function(backendDict) {
/* eslint-enable dot-notation */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ oppia.factory('ExplorationObjectFactory', [

// Static class methods. Note that "this" is not available in
// static contexts.
// TODO (ankita240796) Remove the bracket notation once Angular2 gets in.
// TODO(ankita240796): Remove the bracket notation once Angular2 gets in.
/* eslint-disable dot-notation */
Exploration['createFromBackendDict'] = function(explorationBackendDict) {
/* eslint-enable dot-notation */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
* @fileoverview Unit tests for the Exploration object factory.
*/

// TODO(YashJipkate) Remove the following block of unnnecessary imports once
// TODO(YashJipkate): Remove the following block of unnnecessary imports once
// ExplorationObjectFactory.ts is upgraded to Angular 8.
import { RuleObjectFactory } from 'domain/exploration/RuleObjectFactory.ts';
import { WrittenTranslationObjectFactory } from
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ oppia.factory('HintObjectFactory', [
};
};

// TODO (ankita240796) Remove the bracket notation once Angular2 gets in.
// TODO(ankita240796): Remove the bracket notation once Angular2 gets in.
/* eslint-disable dot-notation */
Hint['createFromBackendDict'] = function(hintBackendDict) {
/* eslint-enable dot-notation */
Expand All @@ -43,7 +43,7 @@ oppia.factory('HintObjectFactory', [
hintBackendDict.hint_content));
};

// TODO (ankita240796) Remove the bracket notation once Angular2 gets in.
// TODO(ankita240796): Remove the bracket notation once Angular2 gets in.
/* eslint-disable dot-notation */
Hint['createNew'] = function(hintContentId, hintContent) {
/* eslint-enable dot-notation */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ oppia.factory('InteractionObjectFactory', [
};
};

// TODO (ankita240796) Remove the bracket notation once Angular2 gets in.
// TODO(ankita240796): Remove the bracket notation once Angular2 gets in.
/* eslint-disable dot-notation */
Interaction['createFromBackendDict'] = function(interactionDict) {
/* eslint-enable dot-notation */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
* @fileoverview Unit tests for Interaction object factory.
*/

// TODO(YashJipkate) Remove the following block of unnnecessary imports once
// TODO(YashJipkate): Remove the following block of unnnecessary imports once
// InteractionObjectFactory.ts is upgraded to Angular 8.
import { RuleObjectFactory } from 'domain/exploration/RuleObjectFactory.ts';
// ^^^ This block is to be removed.
Expand Down
Loading

0 comments on commit d89d68f

Please sign in to comment.