From 51f63c986534f437fe13a0ae7f12ecfcda878b6c Mon Sep 17 00:00:00 2001 From: Yash Jipkate <34203227+YashJipkate@users.noreply.github.com> Date: Fri, 24 May 2019 05:58:48 +0530 Subject: [PATCH] Fix #6364: Added file overview check. (#6451) * Added file overview check * Addressed review * Styling nits * Added file overview part 1 * Added missing fileoverviews * excluded conf files * Added MANDATORY_PATTERNS_JS_REGEXP * Refactored files * Added copyright pattern * Unified mandatory pattern checks for all types * Address review * Proper filename matching * Modified MANDATORY_PATTERNS_REGEXP to pass tests * Made into function * Addressed review * Fix lints * Made checker function no-public * Remove dist files * Added missing file overviews --- assets/constants.js | 5 + assets/rich_text_components_definitions.js | 5 + core/templates/dev/head/AppInit.ts | 4 + .../editor/undo_redo/UndoRedoService.ts | 4 + .../ParamMetadataObjectFactorySpec.ts | 4 +- .../FeedbackThreadObjectFactorySpec.ts | 4 +- .../domain/question/QuestionUpdateService.ts | 4 +- .../skill/ConceptCardObjectFactorySpec.ts | 4 +- .../skill/MisconceptionObjectFactorySpec.ts | 4 +- .../domain/skill/SkillObjectFactorySpec.ts | 4 +- .../head/domain/skill/SkillUpdateService.ts | 4 +- .../domain/skill/SkillUpdateServiceSpec.ts | 4 +- .../suggestion/SuggestionObjectFactorySpec.ts | 4 +- .../SuggestionThreadObjectFactorySpec.ts | 4 +- .../expressions/ExpressionEvaluatorService.ts | 4 + .../ExpressionEvaluatorServiceSpec.ts | 4 + .../ExpressionParserServiceSpec.ts | 4 + .../ExpressionSyntaxTreeService.ts | 4 + .../ExpressionTypeParserService.ts | 4 + .../ExpressionTypeParserServiceSpec.ts | 4 + .../dev/head/pages/contact/Contact.ts | 4 + .../ExplorationDataService.ts | 4 +- .../ExplorationLanguageCodeService.ts | 4 +- .../ExplorationTagsService.ts | 4 +- .../editor_tab/AnswerGroupsCacheService.ts | 10 +- .../editor_tab/SolutionValidityService.ts | 5 +- .../PlaythroughImprovementCardDirective.ts | 4 + .../PlayerPositionServiceSpec.ts | 4 +- .../dev/head/pages/get_started/GetStarted.ts | 4 + .../dev/head/pages/moderator/Moderator.ts | 4 +- .../head/pages/preferences/PreferencesSpec.ts | 4 + .../skill_editor/SkillEditorStateService.ts | 6 +- .../SkillEditorStateServiceSpec.ts | 4 +- .../head/services/AutoplayedVideosService.ts | 4 + .../head/services/DateTimeFormatService.ts | 6 +- .../head/services/ImprovementsServiceSpec.ts | 4 + core/tests/build_sources/extensions/plugin.ts | 5 +- core/tests/protractor/accessibility.js | 2 +- .../additionalEditorAndPlayerFeatures.js | 10 +- .../protractor_desktop/profileFeatures.js | 4 +- core/tests/protractor_mobile/navigation.js | 2 +- extensions/ckeditor_plugins/pre/plugin.ts | 5 +- .../classifiers/CountVectorizerService.ts | 2 +- .../classifiers/PythonProgramTokenizer.ts | 2 +- .../classifiers/SVMPredictionService.ts | 2 +- extensions/classifiers/TextInputTokenizer.ts | 2 +- .../WinnowingPreprocessingService.ts | 2 +- .../CodeRepl/CodeReplPredictionService.ts | 2 +- .../CodeReplValidationServiceSpec.ts | 4 + .../OppiaInteractiveCodeReplDirective.ts | 2 +- .../OppiaResponseCodeReplDirective.ts | 2 +- .../OppiaShortResponseCodeReplDirective.ts | 2 +- .../ContinueValidationServiceSpec.ts | 4 + .../OppiaInteractiveContinueDirective.ts | 2 +- .../OppiaResponseContinueDirective.ts | 2 +- .../OppiaShortResponseContinueDirective.ts | 2 +- ...agAndDropSortInputValidationServiceSpec.ts | 4 + ...nteractiveDragAndDropSortInputDirective.ts | 2 +- ...iaResponseDragAndDropSortInputDirective.ts | 2 +- ...rtResponseDragAndDropSortInputDirective.ts | 2 +- .../EndExplorationValidationServiceSpec.ts | 4 + ...OppiaInteractiveEndExplorationDirective.ts | 2 +- .../OppiaResponseEndExplorationDirective.ts | 2 +- ...piaShortResponseEndExplorationDirective.ts | 2 +- .../FractionInputValidationServiceSpec.ts | 4 + .../OppiaInteractiveFractionInputDirective.ts | 2 +- .../OppiaResponseFractionInputDirective.ts | 2 +- ...ppiaShortResponseFractionInputDirective.ts | 2 +- .../GraphInputValidationServiceSpec.ts | 4 + .../directives/GraphVizDirective.ts | 2 +- .../OppiaInteractiveGraphInputDirective.ts | 2 +- .../OppiaResponseGraphInputDirective.ts | 2 +- .../OppiaShortResponseGraphInputDirective.ts | 2 +- .../ImageClickInputValidationServiceSpec.ts | 4 + ...ppiaInteractiveImageClickInputDirective.ts | 2 +- .../OppiaResponseImageClickInputDirective.ts | 2 +- ...iaShortResponseImageClickInputDirective.ts | 2 +- .../InteractiveMapValidationServiceSpec.ts | 4 + ...OppiaInteractiveInteractiveMapDirective.ts | 2 +- .../OppiaResponseInteractiveMapDirective.ts | 2 +- ...piaShortResponseInteractiveMapDirective.ts | 2 +- ...ItemSelectionInputValidationServiceSpec.ts | 4 + ...aInteractiveItemSelectionInputDirective.ts | 2 +- ...ppiaResponseItemSelectionInputDirective.ts | 2 +- ...hortResponseItemSelectionInputDirective.ts | 2 +- .../LogicProofValidationServiceSpec.ts | 4 + .../OppiaInteractiveLogicProofDirective.ts | 2 +- .../OppiaResponseLogicProofDirective.ts | 2 +- .../OppiaShortResponseLogicProofDirective.ts | 2 +- .../interactions/LogicProof/static/js/data.ts | 4 + .../js/tools/LogicDemoTestController.ts | 4 + .../LogicProof/static/js/tools/strings.ts | 4 + ...InteractiveMathExpressionInputDirective.ts | 2 +- ...piaResponseMathExpressionInputDirective.ts | 2 +- ...ortResponseMathExpressionInputDirective.ts | 2 +- ...ultipleChoiceInputValidationServiceSpec.ts | 4 + ...InteractiveMultipleChoiceInputDirective.ts | 2 +- ...piaResponseMultipleChoiceInputDirective.ts | 2 +- ...ortResponseMultipleChoiceInputDirective.ts | 2 +- .../MusicNotesInputValidationServiceSpec.ts | 4 + ...ppiaInteractiveMusicNotesInputDirective.ts | 2 +- .../OppiaResponseMusicNotesInputDirective.ts | 2 +- ...iaShortResponseMusicNotesInputDirective.ts | 2 +- .../NumberWithUnitsValidationServiceSpec.ts | 4 + ...ppiaInteractiveNumberWithUnitsDirective.ts | 2 +- .../OppiaResponseNumberWithUnitsDirective.ts | 2 +- ...iaShortResponseNumberWithUnitsDirective.ts | 2 +- .../NumericInputValidationServiceSpec.ts | 4 + .../OppiaInteractiveNumericInputDirective.ts | 2 +- .../OppiaResponseNumericInputDirective.ts | 2 +- ...OppiaShortResponseNumericInputDirective.ts | 2 +- ...piaInteractivePencilCodeEditorDirective.ts | 2 +- .../OppiaResponsePencilCodeEditorDirective.ts | 2 +- ...aShortResponsePencilCodeEditorDirective.ts | 2 +- .../OppiaInteractiveSetInputDirective.ts | 2 +- .../OppiaResponseSetInputDirective.ts | 2 +- .../OppiaShortResponseSetInputDirective.ts | 2 +- .../SetInputValidationServiceSpec.ts | 4 + .../TextInput/TextInputPredictionService.ts | 2 +- .../OppiaInteractiveTextInputDirective.ts | 2 +- .../OppiaResponseTextInputDirective.ts | 2 +- .../OppiaShortResponseTextInputDirective.ts | 2 +- .../TextInputValidationServiceSpec.ts | 4 + .../templates/BooleanEditorDirective.ts | 4 + .../templates/CodeStringEditorDirective.ts | 4 + .../templates/CoordTwoDimEditorDirective.ts | 4 + .../DragAndDropHtmlStringEditorDirective.ts | 3 + .../DragAndDropPositiveIntEditorDirective.ts | 3 + .../templates/FilepathEditorDirective.ts | 4 + .../templates/FractionEditorDirective.ts | 3 + .../objects/templates/GraphEditorDirective.ts | 4 + .../templates/GraphPropertyEditorDirective.ts | 4 + .../objects/templates/HtmlEditorDirective.ts | 4 + .../ImageWithRegionsEditorDirective.ts | 4 + .../objects/templates/IntEditorDirective.ts | 4 + .../ListOfSetsOfHtmlStringsEditorDirective.ts | 3 + .../templates/ListOfTabsEditorDirective.ts | 4 + .../ListOfUnicodeStringEditorDirective.ts | 4 + .../LogicErrorCategoryEditorDirective.ts | 4 + .../templates/LogicQuestionEditorDirective.ts | 4 + .../MathLatexStringEditorDirective.ts | 4 + .../templates/MusicPhraseEditorDirective.ts | 4 + .../NonnegativeIntEditorDirective.ts | 4 + .../NormalizedStringEditorDirective.ts | 4 + .../NumberWithUnitsEditorDirective.ts | 3 + .../templates/ParameterNameEditorDirective.ts | 4 + .../objects/templates/RealEditorDirective.ts | 4 + .../templates/SanitizedUrlEditorDirective.ts | 4 + .../SetOfHtmlStringEditorDirective.ts | 4 + .../SetOfUnicodeStringEditorDirective.ts | 4 + .../templates/UnicodeStringEditorDirective.ts | 4 + ...OppiaNoninteractiveCollapsibleDirective.ts | 2 +- .../OppiaNoninteractiveImageDirective.ts | 2 +- .../OppiaNoninteractiveLinkDirective.ts | 2 +- .../OppiaNoninteractiveMathDirective.ts | 2 +- .../OppiaNoninteractiveTabsDirective.ts | 2 +- .../OppiaNoninteractiveVideoDirective.ts | 2 +- .../templates/CopierDirective.ts | 4 + .../templates/RandomSelectorDirective.ts | 4 + scripts/pre_commit_linter.py | 191 ++++++++++++------ webpack.config.ts | 4 + webpack.dev.config.ts | 3 + webpack.prod.config.ts | 3 + 163 files changed, 530 insertions(+), 183 deletions(-) diff --git a/assets/constants.js b/assets/constants.js index 9c50fdf555c4..8282c2f338e8 100644 --- a/assets/constants.js +++ b/assets/constants.js @@ -7,6 +7,11 @@ * 3. All values and keys must be constant, you can't use any Javascript * functions. */ + +/** + * @fileoverview Initializes constants for the Oppia codebase. + */ + var constants = { // Whether to allow custom event reporting to Google Analytics. "CAN_SEND_ANALYTICS_EVENTS": false, diff --git a/assets/rich_text_components_definitions.js b/assets/rich_text_components_definitions.js index 3c8d697b57ad..4ba4498bdad8 100644 --- a/assets/rich_text_components_definitions.js +++ b/assets/rich_text_components_definitions.js @@ -7,6 +7,11 @@ * 3. All values and keys must be constant, you can't use any JavaScript * functions. */ + +/** + * @fileoverview Definitions for rich text components. + */ + var richTextComponents = { "Collapsible": { "backend_id": "Collapsible", diff --git a/core/templates/dev/head/AppInit.ts b/core/templates/dev/head/AppInit.ts index ebfc6f55fcc7..bff5f6a3fd95 100644 --- a/core/templates/dev/head/AppInit.ts +++ b/core/templates/dev/head/AppInit.ts @@ -12,6 +12,10 @@ // See the License for the specific language governing permissions and // limitations under the License. +/** + * @fileoverview File for initializing the main oppia module. + */ + var oppia = angular.module( 'oppia', [ 'angularAudioRecorder', 'dndLists', 'headroom', 'infinite-scroll', diff --git a/core/templates/dev/head/domain/editor/undo_redo/UndoRedoService.ts b/core/templates/dev/head/domain/editor/undo_redo/UndoRedoService.ts index 5afac88a5638..a4aaf80183ca 100644 --- a/core/templates/dev/head/domain/editor/undo_redo/UndoRedoService.ts +++ b/core/templates/dev/head/domain/editor/undo_redo/UndoRedoService.ts @@ -12,6 +12,10 @@ // See the License for the specific language governing permissions and // limitations under the License. +/** + * @fileoverview Undo Redo Service. + */ + require('domain/editor/undo_redo/BaseUndoRedoService.ts'); oppia.factory('UndoRedoService', [ diff --git a/core/templates/dev/head/domain/exploration/ParamMetadataObjectFactorySpec.ts b/core/templates/dev/head/domain/exploration/ParamMetadataObjectFactorySpec.ts index 2ec260d53339..4cca1eb3b431 100644 --- a/core/templates/dev/head/domain/exploration/ParamMetadataObjectFactorySpec.ts +++ b/core/templates/dev/head/domain/exploration/ParamMetadataObjectFactorySpec.ts @@ -13,8 +13,8 @@ // limitations under the License. /** -* @fileoverview Unit tests for ParamMetadataObjectFactory. -*/ + * @fileoverview Unit tests for ParamMetadataObjectFactory. + */ require('domain/exploration/ParamMetadataObjectFactory.ts'); diff --git a/core/templates/dev/head/domain/feedback_thread/FeedbackThreadObjectFactorySpec.ts b/core/templates/dev/head/domain/feedback_thread/FeedbackThreadObjectFactorySpec.ts index 0a407b292f41..6a9e1ba8119b 100644 --- a/core/templates/dev/head/domain/feedback_thread/FeedbackThreadObjectFactorySpec.ts +++ b/core/templates/dev/head/domain/feedback_thread/FeedbackThreadObjectFactorySpec.ts @@ -13,8 +13,8 @@ // limitations under the License. /** -* @fileoverview Unit tests for FeedbackThreadObjectFactory. -*/ + * @fileoverview Unit tests for FeedbackThreadObjectFactory. + */ require('domain/feedback_thread/FeedbackThreadObjectFactory.ts'); diff --git a/core/templates/dev/head/domain/question/QuestionUpdateService.ts b/core/templates/dev/head/domain/question/QuestionUpdateService.ts index 104091d7a9c2..efd9ef13cbe4 100644 --- a/core/templates/dev/head/domain/question/QuestionUpdateService.ts +++ b/core/templates/dev/head/domain/question/QuestionUpdateService.ts @@ -13,8 +13,8 @@ // limitations under the License. /** -* @fileoverview Service to handle the updating of a question. -*/ + * @fileoverview Service to handle the updating of a question. + */ require('domain/editor/undo_redo/ChangeObjectFactory.ts'); require('domain/editor/undo_redo/QuestionUndoRedoService.ts'); diff --git a/core/templates/dev/head/domain/skill/ConceptCardObjectFactorySpec.ts b/core/templates/dev/head/domain/skill/ConceptCardObjectFactorySpec.ts index ebaa245af29b..447daf6938da 100644 --- a/core/templates/dev/head/domain/skill/ConceptCardObjectFactorySpec.ts +++ b/core/templates/dev/head/domain/skill/ConceptCardObjectFactorySpec.ts @@ -13,8 +13,8 @@ // limitations under the License. /** -* @fileoverview Unit tests for ConceptCardObjectFactory. -*/ + * @fileoverview Unit tests for ConceptCardObjectFactory. + */ require('App.ts'); require('domain/exploration/SubtitledHtmlObjectFactory.ts'); diff --git a/core/templates/dev/head/domain/skill/MisconceptionObjectFactorySpec.ts b/core/templates/dev/head/domain/skill/MisconceptionObjectFactorySpec.ts index ec23333d0150..ea1e2c3b103c 100644 --- a/core/templates/dev/head/domain/skill/MisconceptionObjectFactorySpec.ts +++ b/core/templates/dev/head/domain/skill/MisconceptionObjectFactorySpec.ts @@ -13,8 +13,8 @@ // limitations under the License. /** -* @fileoverview Unit tests for MisconceptionObjectFacfory. -*/ + * @fileoverview Unit tests for MisconceptionObjectFacfory. + */ require('domain/skill/MisconceptionObjectFactory.ts'); diff --git a/core/templates/dev/head/domain/skill/SkillObjectFactorySpec.ts b/core/templates/dev/head/domain/skill/SkillObjectFactorySpec.ts index 99ed4be27ef7..a8175c2b6c46 100644 --- a/core/templates/dev/head/domain/skill/SkillObjectFactorySpec.ts +++ b/core/templates/dev/head/domain/skill/SkillObjectFactorySpec.ts @@ -13,8 +13,8 @@ // limitations under the License. /** -* @fileoverview Unit tests for SkillObjectFactory. -*/ + * @fileoverview Unit tests for SkillObjectFactory. + */ require('App.ts'); require('domain/skill/ConceptCardObjectFactory.ts'); diff --git a/core/templates/dev/head/domain/skill/SkillUpdateService.ts b/core/templates/dev/head/domain/skill/SkillUpdateService.ts index f945990638ca..51cf9618fbc4 100644 --- a/core/templates/dev/head/domain/skill/SkillUpdateService.ts +++ b/core/templates/dev/head/domain/skill/SkillUpdateService.ts @@ -13,8 +13,8 @@ // limitations under the License. /** -* @fileoverview Service to handle the updating of a skill. -*/ + * @fileoverview Service to handle the updating of a skill. + */ require('domain/editor/undo_redo/ChangeObjectFactory.ts'); require('domain/editor/undo_redo/UndoRedoService.ts'); diff --git a/core/templates/dev/head/domain/skill/SkillUpdateServiceSpec.ts b/core/templates/dev/head/domain/skill/SkillUpdateServiceSpec.ts index da19b9dbda1e..f5c0828cfe8e 100644 --- a/core/templates/dev/head/domain/skill/SkillUpdateServiceSpec.ts +++ b/core/templates/dev/head/domain/skill/SkillUpdateServiceSpec.ts @@ -13,8 +13,8 @@ // limitations under the License. /** -* @fileoverview Unit tests for SkillUpdateService. -*/ + * @fileoverview Unit tests for SkillUpdateService. + */ require('App.ts'); require('domain/editor/undo_redo/UndoRedoService.ts'); diff --git a/core/templates/dev/head/domain/suggestion/SuggestionObjectFactorySpec.ts b/core/templates/dev/head/domain/suggestion/SuggestionObjectFactorySpec.ts index 4d51c25c5fff..54ca5cc147ba 100644 --- a/core/templates/dev/head/domain/suggestion/SuggestionObjectFactorySpec.ts +++ b/core/templates/dev/head/domain/suggestion/SuggestionObjectFactorySpec.ts @@ -13,8 +13,8 @@ // limitations under the License. /** -* @fileoverview Unit tests for SuggestionObjectFactory. -*/ + * @fileoverview Unit tests for SuggestionObjectFactory. + */ require('domain/suggestion/SuggestionObjectFactory.ts'); diff --git a/core/templates/dev/head/domain/suggestion/SuggestionThreadObjectFactorySpec.ts b/core/templates/dev/head/domain/suggestion/SuggestionThreadObjectFactorySpec.ts index 4bd9d0fe84c8..6c4973aff88b 100644 --- a/core/templates/dev/head/domain/suggestion/SuggestionThreadObjectFactorySpec.ts +++ b/core/templates/dev/head/domain/suggestion/SuggestionThreadObjectFactorySpec.ts @@ -13,8 +13,8 @@ // limitations under the License. /** -* @fileoverview Unit tests for SuggestionThreadObjectFactory. -*/ + * @fileoverview Unit tests for SuggestionThreadObjectFactory. + */ require('domain/suggestion/SuggestionObjectFactory.ts'); require('domain/suggestion/SuggestionThreadObjectFactory.ts'); diff --git a/core/templates/dev/head/expressions/ExpressionEvaluatorService.ts b/core/templates/dev/head/expressions/ExpressionEvaluatorService.ts index 9ad751e66dfb..5b0520c938b8 100644 --- a/core/templates/dev/head/expressions/ExpressionEvaluatorService.ts +++ b/core/templates/dev/head/expressions/ExpressionEvaluatorService.ts @@ -58,6 +58,10 @@ // Constraints on the input arguments (number, types, and any other // constraints) as well as the output value and type should be documented. +/** + * @fileoverview Service for expression evaluation. + */ + require('expressions/ExpressionParserService.js'); require('expressions/ExpressionSyntaxTreeService.ts'); diff --git a/core/templates/dev/head/expressions/ExpressionEvaluatorServiceSpec.ts b/core/templates/dev/head/expressions/ExpressionEvaluatorServiceSpec.ts index df51b8581962..81aeb3a907f9 100644 --- a/core/templates/dev/head/expressions/ExpressionEvaluatorServiceSpec.ts +++ b/core/templates/dev/head/expressions/ExpressionEvaluatorServiceSpec.ts @@ -12,6 +12,10 @@ // See the License for the specific language governing permissions and // limitations under the License. +/** + * @fileoverview Unit tests for Expression Evaluator Service. + */ + require('App.ts'); require('expressions/ExpressionEvaluatorService.ts'); require('expressions/ExpressionParserService.js'); diff --git a/core/templates/dev/head/expressions/ExpressionParserServiceSpec.ts b/core/templates/dev/head/expressions/ExpressionParserServiceSpec.ts index 3b16ab4a4bd6..e058db0ea0a2 100644 --- a/core/templates/dev/head/expressions/ExpressionParserServiceSpec.ts +++ b/core/templates/dev/head/expressions/ExpressionParserServiceSpec.ts @@ -12,6 +12,10 @@ // See the License for the specific language governing permissions and // limitations under the License. +/** + * @fileoverview Unit tests for Expression Parser Service. + */ + require('expressions/ExpressionParserService.js'); describe('Expression parser service', function() { diff --git a/core/templates/dev/head/expressions/ExpressionSyntaxTreeService.ts b/core/templates/dev/head/expressions/ExpressionSyntaxTreeService.ts index a7d026e9165b..dcd753ffbee7 100644 --- a/core/templates/dev/head/expressions/ExpressionSyntaxTreeService.ts +++ b/core/templates/dev/head/expressions/ExpressionSyntaxTreeService.ts @@ -12,6 +12,10 @@ // See the License for the specific language governing permissions and // limitations under the License. +/** + * @fileoverview Expression syntax tree service. + */ + require('expressions/ExpressionParserService.js'); oppia.factory('ExpressionSyntaxTreeService', [ diff --git a/core/templates/dev/head/expressions/ExpressionTypeParserService.ts b/core/templates/dev/head/expressions/ExpressionTypeParserService.ts index 25ec07b199bc..13bfd5a35dcd 100644 --- a/core/templates/dev/head/expressions/ExpressionTypeParserService.ts +++ b/core/templates/dev/head/expressions/ExpressionTypeParserService.ts @@ -12,6 +12,10 @@ // See the License for the specific language governing permissions and // limitations under the License. +/** + * @fileoverview Unit tests for Expression Type Parser Service. + */ + require('expressions/ExpressionParserService.js'); require('expressions/ExpressionSyntaxTreeService.ts'); diff --git a/core/templates/dev/head/expressions/ExpressionTypeParserServiceSpec.ts b/core/templates/dev/head/expressions/ExpressionTypeParserServiceSpec.ts index 2914a1d9dc49..60be0426fc6f 100644 --- a/core/templates/dev/head/expressions/ExpressionTypeParserServiceSpec.ts +++ b/core/templates/dev/head/expressions/ExpressionTypeParserServiceSpec.ts @@ -12,6 +12,10 @@ // See the License for the specific language governing permissions and // limitations under the License. +/** + * @fileoverview Unit tests for Expression Type Parser Service. + */ + require('App.ts'); require('expressions/ExpressionParserService.js'); require('expressions/ExpressionSyntaxTreeService.ts'); diff --git a/core/templates/dev/head/pages/contact/Contact.ts b/core/templates/dev/head/pages/contact/Contact.ts index 6e9ac5a621fc..1cdc85e94d51 100644 --- a/core/templates/dev/head/pages/contact/Contact.ts +++ b/core/templates/dev/head/pages/contact/Contact.ts @@ -12,4 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. +/** + * @fileoverview File to import necessary scripts for contact page. + */ + require('components/background/BackgroundBannerDirective.ts'); diff --git a/core/templates/dev/head/pages/exploration_editor/ExplorationDataService.ts b/core/templates/dev/head/pages/exploration_editor/ExplorationDataService.ts index a5a897c42215..2555591f16c5 100644 --- a/core/templates/dev/head/pages/exploration_editor/ExplorationDataService.ts +++ b/core/templates/dev/head/pages/exploration_editor/ExplorationDataService.ts @@ -13,8 +13,8 @@ // limitations under the License. /** - * @fileoverview Service for handling all interactions - * with the exploration editor backend. + * @fileoverview Service for handling all interactions + * with the exploration editor backend. */ require('domain/exploration/EditableExplorationBackendApiService.ts'); diff --git a/core/templates/dev/head/pages/exploration_editor/ExplorationLanguageCodeService.ts b/core/templates/dev/head/pages/exploration_editor/ExplorationLanguageCodeService.ts index 00d17aa4b0a1..2aef572771ef 100644 --- a/core/templates/dev/head/pages/exploration_editor/ExplorationLanguageCodeService.ts +++ b/core/templates/dev/head/pages/exploration_editor/ExplorationLanguageCodeService.ts @@ -12,7 +12,9 @@ // See the License for the specific language governing permissions and // limitations under the License. -/** @fileoverview A data service that stores the exploration language code. */ +/** + * @fileoverview A data service that stores the exploration language code. + */ require('pages/exploration_editor/ExplorationPropertyService.ts'); diff --git a/core/templates/dev/head/pages/exploration_editor/ExplorationTagsService.ts b/core/templates/dev/head/pages/exploration_editor/ExplorationTagsService.ts index 923d74fba1f4..e00897a98af5 100644 --- a/core/templates/dev/head/pages/exploration_editor/ExplorationTagsService.ts +++ b/core/templates/dev/head/pages/exploration_editor/ExplorationTagsService.ts @@ -12,7 +12,9 @@ // See the License for the specific language governing permissions and // limitations under the License. -/** @fileoverview A data service that stores tags for the exploration. */ +/** + * @fileoverview A data service that stores tags for the exploration. + */ require('pages/exploration_editor/ExplorationPropertyService.ts'); diff --git a/core/templates/dev/head/pages/exploration_editor/editor_tab/AnswerGroupsCacheService.ts b/core/templates/dev/head/pages/exploration_editor/editor_tab/AnswerGroupsCacheService.ts index 9bae6e2d2c3e..77cdae7e0dea 100644 --- a/core/templates/dev/head/pages/exploration_editor/editor_tab/AnswerGroupsCacheService.ts +++ b/core/templates/dev/head/pages/exploration_editor/editor_tab/AnswerGroupsCacheService.ts @@ -13,11 +13,11 @@ // limitations under the License. /** -* @fileoverview A state-specific cache for interaction handlers. It stores -* handlers corresponding to an interaction id so that they can be restored if -* the interaction is changed back while the user is still in this state. -* This cache should be reset each time the state editor is initialized. -*/ + * @fileoverview A state-specific cache for interaction handlers. It stores + * handlers corresponding to an interaction id so that they can be restored if + * the interaction is changed back while the user is still in this state. + * This cache should be reset each time the state editor is initialized. + */ oppia.factory('AnswerGroupsCacheService', [function() { var _cache = {}; diff --git a/core/templates/dev/head/pages/exploration_editor/editor_tab/SolutionValidityService.ts b/core/templates/dev/head/pages/exploration_editor/editor_tab/SolutionValidityService.ts index 85abfc10706e..d30c93fe74ba 100644 --- a/core/templates/dev/head/pages/exploration_editor/editor_tab/SolutionValidityService.ts +++ b/core/templates/dev/head/pages/exploration_editor/editor_tab/SolutionValidityService.ts @@ -12,7 +12,10 @@ // See the License for the specific language governing permissions and // limitations under the License. -// Service for keeping track of solution validity. +/** + * @fileoverview Service for keeping track of solution validity. + */ + oppia.factory('SolutionValidityService', [ function() { return { diff --git a/core/templates/dev/head/pages/exploration_editor/improvements_tab/PlaythroughImprovementCardDirective.ts b/core/templates/dev/head/pages/exploration_editor/improvements_tab/PlaythroughImprovementCardDirective.ts index 6f5b4d015a90..9f5238544b17 100644 --- a/core/templates/dev/head/pages/exploration_editor/improvements_tab/PlaythroughImprovementCardDirective.ts +++ b/core/templates/dev/head/pages/exploration_editor/improvements_tab/PlaythroughImprovementCardDirective.ts @@ -12,6 +12,10 @@ // See the License for the specific language governing permissions and // limitations under the License. +/** + * @fileoverview Playthrough Improvement card directive. + */ + require('domain/utilities/UrlInterpolationService.ts'); require('services/PlaythroughIssuesService.ts'); diff --git a/core/templates/dev/head/pages/exploration_player/PlayerPositionServiceSpec.ts b/core/templates/dev/head/pages/exploration_player/PlayerPositionServiceSpec.ts index dcb1fae6c6d4..295f893b4642 100644 --- a/core/templates/dev/head/pages/exploration_player/PlayerPositionServiceSpec.ts +++ b/core/templates/dev/head/pages/exploration_player/PlayerPositionServiceSpec.ts @@ -13,8 +13,8 @@ // limitations under the License. /** -* @fileoverview Unit tests for the player position service. -*/ + * @fileoverview Unit tests for the player position service. + */ require('domain/state_card/StateCardObjectFactory.ts'); require('pages/exploration_player/PlayerPositionService.ts'); diff --git a/core/templates/dev/head/pages/get_started/GetStarted.ts b/core/templates/dev/head/pages/get_started/GetStarted.ts index 6e9ac5a621fc..612be8057422 100644 --- a/core/templates/dev/head/pages/get_started/GetStarted.ts +++ b/core/templates/dev/head/pages/get_started/GetStarted.ts @@ -12,4 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. +/** + * @fileoverview File to import necessary scripts for get_started page. + */ + require('components/background/BackgroundBannerDirective.ts'); diff --git a/core/templates/dev/head/pages/moderator/Moderator.ts b/core/templates/dev/head/pages/moderator/Moderator.ts index 6879d8a58d0b..7fd46a2afb6d 100644 --- a/core/templates/dev/head/pages/moderator/Moderator.ts +++ b/core/templates/dev/head/pages/moderator/Moderator.ts @@ -13,8 +13,8 @@ // limitations under the License. /** -* @fileoverview Data and controllers for the Oppia moderator page. -*/ + * @fileoverview Data and controllers for the Oppia moderator page. + */ // TODO(vojtechjelinek): this block of requires should be removed after we // introduce webpack for /extensions diff --git a/core/templates/dev/head/pages/preferences/PreferencesSpec.ts b/core/templates/dev/head/pages/preferences/PreferencesSpec.ts index 0001f5ca8634..bb78ad5fba5a 100644 --- a/core/templates/dev/head/pages/preferences/PreferencesSpec.ts +++ b/core/templates/dev/head/pages/preferences/PreferencesSpec.ts @@ -12,6 +12,10 @@ // See the License for the specific language governing permissions and // limitations under the License. +/** + * @fileoverview Unit tests for the Preferences page. + */ + require('pages/preferences/Preferences.ts'); describe('Preferences Controller', function() { diff --git a/core/templates/dev/head/pages/skill_editor/SkillEditorStateService.ts b/core/templates/dev/head/pages/skill_editor/SkillEditorStateService.ts index 9f3bb6ee1141..6c12706ef2a9 100644 --- a/core/templates/dev/head/pages/skill_editor/SkillEditorStateService.ts +++ b/core/templates/dev/head/pages/skill_editor/SkillEditorStateService.ts @@ -13,9 +13,9 @@ // limitations under the License. /** -* @fileoverview Service for managing the state of the skill being edited -* in the skill editor. -*/ + * @fileoverview Service for managing the state of the skill being edited + * in the skill editor. + */ require('domain/editor/undo_redo/UndoRedoService.ts'); require('domain/skill/EditableSkillBackendApiService.ts'); diff --git a/core/templates/dev/head/pages/skill_editor/SkillEditorStateServiceSpec.ts b/core/templates/dev/head/pages/skill_editor/SkillEditorStateServiceSpec.ts index 313c951ff2d1..ec8fac7f15b7 100644 --- a/core/templates/dev/head/pages/skill_editor/SkillEditorStateServiceSpec.ts +++ b/core/templates/dev/head/pages/skill_editor/SkillEditorStateServiceSpec.ts @@ -13,8 +13,8 @@ // limitations under the License. /** -* @fileoverview Unit tests for SkillEditorStateService.js -*/ + * @fileoverview Unit tests for SkillEditorStateService.js + */ require('domain/skill/SkillObjectFactory.ts'); require('domain/skill/SkillRightsObjectFactory.ts'); diff --git a/core/templates/dev/head/services/AutoplayedVideosService.ts b/core/templates/dev/head/services/AutoplayedVideosService.ts index c8a265d669ff..163e2131fbc2 100644 --- a/core/templates/dev/head/services/AutoplayedVideosService.ts +++ b/core/templates/dev/head/services/AutoplayedVideosService.ts @@ -12,6 +12,10 @@ // See the License for the specific language governing permissions and // limitations under the License. +/** + * @fileoverview Autoplayed videos service. + */ + // About this service: // In the exploration player, a video should only autoplay when it is first seen // on a new card, and not when the learner clicks back to previous cards in diff --git a/core/templates/dev/head/services/DateTimeFormatService.ts b/core/templates/dev/head/services/DateTimeFormatService.ts index 062a509de142..6795d07e53a3 100644 --- a/core/templates/dev/head/services/DateTimeFormatService.ts +++ b/core/templates/dev/head/services/DateTimeFormatService.ts @@ -13,9 +13,9 @@ // limitations under the License. /** -* @fileoverview Service for converting dates in milliseconds -* since the Epoch to human-readable dates. -*/ + * @fileoverview Service for converting dates in milliseconds + * since the Epoch to human-readable dates. + */ oppia.factory('DateTimeFormatService', ['$filter', function($filter) { return { diff --git a/core/templates/dev/head/services/ImprovementsServiceSpec.ts b/core/templates/dev/head/services/ImprovementsServiceSpec.ts index 515c49609e46..ac9825096628 100644 --- a/core/templates/dev/head/services/ImprovementsServiceSpec.ts +++ b/core/templates/dev/head/services/ImprovementsServiceSpec.ts @@ -12,6 +12,10 @@ // See the License for the specific language governing permissions and // limitations under the License. +/** + * @fileoverview Unit tests for improvements service. + */ + require('services/ImprovementsService.ts'); describe('ImprovementsService', function() { diff --git a/core/tests/build_sources/extensions/plugin.ts b/core/tests/build_sources/extensions/plugin.ts index 2ebf8a8795b1..22f29df1309a 100644 --- a/core/tests/build_sources/extensions/plugin.ts +++ b/core/tests/build_sources/extensions/plugin.ts @@ -12,7 +12,10 @@ // See the License for the specific language governing permissions and // limitations under the License. -// Adds pre plugin to CKEditor RTE. +/** + * @fileoverview Adds pre plugin to CKEditor RTE. + */ + CKEDITOR.plugins.add('pre', { icons: 'pre', diff --git a/core/tests/protractor/accessibility.js b/core/tests/protractor/accessibility.js index de3c1663bb7b..c11cb34dd828 100644 --- a/core/tests/protractor/accessibility.js +++ b/core/tests/protractor/accessibility.js @@ -13,7 +13,7 @@ // limitations under the License. /** - * @fileoverview End-to-end tests for testing accessibility features + * @fileoverview End-to-end tests for testing accessibility features * and check for any console errors */ diff --git a/core/tests/protractor_desktop/additionalEditorAndPlayerFeatures.js b/core/tests/protractor_desktop/additionalEditorAndPlayerFeatures.js index 32093c3f36e2..f15e8bb8743e 100644 --- a/core/tests/protractor_desktop/additionalEditorAndPlayerFeatures.js +++ b/core/tests/protractor_desktop/additionalEditorAndPlayerFeatures.js @@ -13,11 +13,11 @@ // limitations under the License. /** -* @fileoverview End-to-end tests for additional features of the exploration -* editor and player. Additional features include those features without which -* an exploration can still be published. These include hints, solutions, -* refresher explorations, state parameters, etc. -*/ + * @fileoverview End-to-end tests for additional features of the exploration + * editor and player. Additional features include those features without which + * an exploration can still be published. These include hints, solutions, + * refresher explorations, state parameters, etc. + */ var forms = require('../protractor_utils/forms.js'); var general = require('../protractor_utils/general.js'); diff --git a/core/tests/protractor_desktop/profileFeatures.js b/core/tests/protractor_desktop/profileFeatures.js index 94e61028aac2..7c2be2bffc89 100644 --- a/core/tests/protractor_desktop/profileFeatures.js +++ b/core/tests/protractor_desktop/profileFeatures.js @@ -13,5 +13,5 @@ // limitations under the License. /** -* @fileoverview End-to-end tests for user profile features. -*/ + * @fileoverview End-to-end tests for user profile features. + */ diff --git a/core/tests/protractor_mobile/navigation.js b/core/tests/protractor_mobile/navigation.js index f0654a4353c1..c1ce0bdeea56 100644 --- a/core/tests/protractor_mobile/navigation.js +++ b/core/tests/protractor_mobile/navigation.js @@ -13,7 +13,7 @@ // limitations under the License. /** - * @fileoverview End-to-end tests for testing navigation + * @fileoverview End-to-end tests for testing navigation * on mobile as a guest and check for any console errors. */ diff --git a/extensions/ckeditor_plugins/pre/plugin.ts b/extensions/ckeditor_plugins/pre/plugin.ts index 2ebf8a8795b1..22f29df1309a 100644 --- a/extensions/ckeditor_plugins/pre/plugin.ts +++ b/extensions/ckeditor_plugins/pre/plugin.ts @@ -12,7 +12,10 @@ // See the License for the specific language governing permissions and // limitations under the License. -// Adds pre plugin to CKEditor RTE. +/** + * @fileoverview Adds pre plugin to CKEditor RTE. + */ + CKEDITOR.plugins.add('pre', { icons: 'pre', diff --git a/extensions/classifiers/CountVectorizerService.ts b/extensions/classifiers/CountVectorizerService.ts index 51667613aee4..f5847b9511b1 100644 --- a/extensions/classifiers/CountVectorizerService.ts +++ b/extensions/classifiers/CountVectorizerService.ts @@ -13,7 +13,7 @@ // limitations under the License. /** - * Vectorizer function which mirrors the CountVectorizer feature + * @fileoverview Vectorizer function which mirrors the CountVectorizer feature * extractor of sklearn. * * IMPORTANT NOTE: The Vectorizer function uses the vocabulary that was diff --git a/extensions/classifiers/PythonProgramTokenizer.ts b/extensions/classifiers/PythonProgramTokenizer.ts index f20c8202b0a1..4698e6dc0181 100644 --- a/extensions/classifiers/PythonProgramTokenizer.ts +++ b/extensions/classifiers/PythonProgramTokenizer.ts @@ -13,7 +13,7 @@ // limitations under the License. /** - * Tokenizer for Python code. + * @fileoverview Tokenizer for Python code. * * IMPORTANT NOTE: The tokenizer is built using Python's own tokenizer module. * These functions are simply translated from Python code to JS code and they diff --git a/extensions/classifiers/SVMPredictionService.ts b/extensions/classifiers/SVMPredictionService.ts index f56165f7aa53..0234fd5a047e 100644 --- a/extensions/classifiers/SVMPredictionService.ts +++ b/extensions/classifiers/SVMPredictionService.ts @@ -13,7 +13,7 @@ // limitations under the License. /** - * SVM predict function for SVC classifier of sklearn. + * @fileoverview SVM predict function for SVC classifier of sklearn. * * IMPORTANT NOTE: The predict function uses svm data that was extracted * after training of classifier on Oppia-ml. If there are any changes in diff --git a/extensions/classifiers/TextInputTokenizer.ts b/extensions/classifiers/TextInputTokenizer.ts index 5b4a7b41b45f..7b70d5ba8659 100644 --- a/extensions/classifiers/TextInputTokenizer.ts +++ b/extensions/classifiers/TextInputTokenizer.ts @@ -13,7 +13,7 @@ // limitations under the License. /** - * Tokenizer for TextInput. + * @fileoverview Tokenizer for TextInput. * * Note: This is a simple tokenizer for tokenizing text input. The parameter * n_grams is used for deciding if we need to add n_gram tokens other than diff --git a/extensions/classifiers/WinnowingPreprocessingService.ts b/extensions/classifiers/WinnowingPreprocessingService.ts index 12ccfa7df012..f4995384d5e5 100644 --- a/extensions/classifiers/WinnowingPreprocessingService.ts +++ b/extensions/classifiers/WinnowingPreprocessingService.ts @@ -13,7 +13,7 @@ // limitations under the License. /** - * Winnowing preprocessing functions. + * @fileoverview Winnowing preprocessing functions. * * IMPORTANT NOTE: The preprocessing functions are implemented according to * winnowing preprocessing functions used on Oppia-ml. These functions diff --git a/extensions/interactions/CodeRepl/CodeReplPredictionService.ts b/extensions/interactions/CodeRepl/CodeReplPredictionService.ts index d06e413066b9..3ee2d6dd852d 100644 --- a/extensions/interactions/CodeRepl/CodeReplPredictionService.ts +++ b/extensions/interactions/CodeRepl/CodeReplPredictionService.ts @@ -13,7 +13,7 @@ // limitations under the License. /** - * CodeRepl interaction prediction functions. + * @fileoverview CodeRepl interaction prediction functions. * * IMPORTANT NOTE: The prediction function uses the classifier data * of trained model (code classifier model) for inference. These functions diff --git a/extensions/interactions/CodeRepl/directives/CodeReplValidationServiceSpec.ts b/extensions/interactions/CodeRepl/directives/CodeReplValidationServiceSpec.ts index e97d09dd3048..6edbc482c593 100644 --- a/extensions/interactions/CodeRepl/directives/CodeReplValidationServiceSpec.ts +++ b/extensions/interactions/CodeRepl/directives/CodeReplValidationServiceSpec.ts @@ -12,6 +12,10 @@ // See the License for the specific language governing permissions and // limitations under the License. +/** + * @fileoverview Unit tests for code repl input validation service. + */ + describe('CodeReplValidationService', function() { var WARNING_TYPES, validatorService; var currentState, customizationArguments; diff --git a/extensions/interactions/CodeRepl/directives/OppiaInteractiveCodeReplDirective.ts b/extensions/interactions/CodeRepl/directives/OppiaInteractiveCodeReplDirective.ts index cd77d469c15c..d29dd9932a62 100644 --- a/extensions/interactions/CodeRepl/directives/OppiaInteractiveCodeReplDirective.ts +++ b/extensions/interactions/CodeRepl/directives/OppiaInteractiveCodeReplDirective.ts @@ -13,7 +13,7 @@ // limitations under the License. /** - * Directive for the CodeRepl interaction. + * @fileoverview Directive for the CodeRepl interaction. * * IMPORTANT NOTE: The naming convention for customization args that are passed * into the directive is: the name of the parameter, followed by 'With', diff --git a/extensions/interactions/CodeRepl/directives/OppiaResponseCodeReplDirective.ts b/extensions/interactions/CodeRepl/directives/OppiaResponseCodeReplDirective.ts index 6f882882a4a1..6f689166abc8 100644 --- a/extensions/interactions/CodeRepl/directives/OppiaResponseCodeReplDirective.ts +++ b/extensions/interactions/CodeRepl/directives/OppiaResponseCodeReplDirective.ts @@ -13,7 +13,7 @@ // limitations under the License. /** - * Directive for the CodeRepl response. + * @fileoverview Directive for the CodeRepl response. * * IMPORTANT NOTE: The naming convention for customization args that are passed * into the directive is: the name of the parameter, followed by 'With', diff --git a/extensions/interactions/CodeRepl/directives/OppiaShortResponseCodeReplDirective.ts b/extensions/interactions/CodeRepl/directives/OppiaShortResponseCodeReplDirective.ts index 48485bb77508..35efd738d26e 100644 --- a/extensions/interactions/CodeRepl/directives/OppiaShortResponseCodeReplDirective.ts +++ b/extensions/interactions/CodeRepl/directives/OppiaShortResponseCodeReplDirective.ts @@ -13,7 +13,7 @@ // limitations under the License. /** - * Directive for the CodeRepl short response. + * @fileoverview Directive for the CodeRepl short response. * * IMPORTANT NOTE: The naming convention for customization args that are passed * into the directive is: the name of the parameter, followed by 'With', diff --git a/extensions/interactions/Continue/directives/ContinueValidationServiceSpec.ts b/extensions/interactions/Continue/directives/ContinueValidationServiceSpec.ts index 19aa662f53a2..d76be68f6737 100644 --- a/extensions/interactions/Continue/directives/ContinueValidationServiceSpec.ts +++ b/extensions/interactions/Continue/directives/ContinueValidationServiceSpec.ts @@ -12,6 +12,10 @@ // See the License for the specific language governing permissions and // limitations under the License. +/** + * @fileoverview Unit tests for continue validation service. + */ + describe('ContinueValidationService', function() { var validatorService, WARNING_TYPES; diff --git a/extensions/interactions/Continue/directives/OppiaInteractiveContinueDirective.ts b/extensions/interactions/Continue/directives/OppiaInteractiveContinueDirective.ts index da6ced50b0b7..35bb1338c295 100644 --- a/extensions/interactions/Continue/directives/OppiaInteractiveContinueDirective.ts +++ b/extensions/interactions/Continue/directives/OppiaInteractiveContinueDirective.ts @@ -13,7 +13,7 @@ // limitations under the License. /** - * Directive for the Continue button interaction. + * @fileoverview Directive for the Continue button interaction. * * IMPORTANT NOTE: The naming convention for customization args that are passed * into the directive is: the name of the parameter, followed by 'With', diff --git a/extensions/interactions/Continue/directives/OppiaResponseContinueDirective.ts b/extensions/interactions/Continue/directives/OppiaResponseContinueDirective.ts index d7a6fcfa9ca1..d9ea3ab8affd 100644 --- a/extensions/interactions/Continue/directives/OppiaResponseContinueDirective.ts +++ b/extensions/interactions/Continue/directives/OppiaResponseContinueDirective.ts @@ -13,7 +13,7 @@ // limitations under the License. /** - * Directive for the Continue button response. + * @fileoverview Directive for the Continue button response. * * IMPORTANT NOTE: The naming convention for customization args that are passed * into the directive is: the name of the parameter, followed by 'With', diff --git a/extensions/interactions/Continue/directives/OppiaShortResponseContinueDirective.ts b/extensions/interactions/Continue/directives/OppiaShortResponseContinueDirective.ts index f038a864775a..6c7f49d57e79 100644 --- a/extensions/interactions/Continue/directives/OppiaShortResponseContinueDirective.ts +++ b/extensions/interactions/Continue/directives/OppiaShortResponseContinueDirective.ts @@ -13,7 +13,7 @@ // limitations under the License. /** - * Directive for the Continue button short response. + * @fileoverview Directive for the Continue button short response. * * IMPORTANT NOTE: The naming convention for customization args that are passed * into the directive is: the name of the parameter, followed by 'With', diff --git a/extensions/interactions/DragAndDropSortInput/directives/DragAndDropSortInputValidationServiceSpec.ts b/extensions/interactions/DragAndDropSortInput/directives/DragAndDropSortInputValidationServiceSpec.ts index 15a64a298404..c3775652fed8 100644 --- a/extensions/interactions/DragAndDropSortInput/directives/DragAndDropSortInputValidationServiceSpec.ts +++ b/extensions/interactions/DragAndDropSortInput/directives/DragAndDropSortInputValidationServiceSpec.ts @@ -12,6 +12,10 @@ // See the License for the specific language governing permissions and // limitations under the License. +/** + * @fileoverview Unit tests for drag and drop sort input validation service. + */ + describe('DragAndDropSortInputValidationService', function() { var validatorService, WARNING_TYPES; diff --git a/extensions/interactions/DragAndDropSortInput/directives/OppiaInteractiveDragAndDropSortInputDirective.ts b/extensions/interactions/DragAndDropSortInput/directives/OppiaInteractiveDragAndDropSortInputDirective.ts index 2ed5b7f3cbe7..9f79c2f1c98e 100644 --- a/extensions/interactions/DragAndDropSortInput/directives/OppiaInteractiveDragAndDropSortInputDirective.ts +++ b/extensions/interactions/DragAndDropSortInput/directives/OppiaInteractiveDragAndDropSortInputDirective.ts @@ -13,7 +13,7 @@ // limitations under the License. /** - * Directive for the DragAndDropSortInput interaction. + * @fileoverview Directive for the DragAndDropSortInput interaction. */ oppia.directive('oppiaInteractiveDragAndDropSortInput', [ diff --git a/extensions/interactions/DragAndDropSortInput/directives/OppiaResponseDragAndDropSortInputDirective.ts b/extensions/interactions/DragAndDropSortInput/directives/OppiaResponseDragAndDropSortInputDirective.ts index e0aa5f08568f..0e637d024c0e 100644 --- a/extensions/interactions/DragAndDropSortInput/directives/OppiaResponseDragAndDropSortInputDirective.ts +++ b/extensions/interactions/DragAndDropSortInput/directives/OppiaResponseDragAndDropSortInputDirective.ts @@ -13,7 +13,7 @@ // limitations under the License. /** - * Directive for the DragAndDropSortInput response. + * @fileoverview Directive for the DragAndDropSortInput response. */ oppia.directive('oppiaResponseDragAndDropSortInput', [ diff --git a/extensions/interactions/DragAndDropSortInput/directives/OppiaShortResponseDragAndDropSortInputDirective.ts b/extensions/interactions/DragAndDropSortInput/directives/OppiaShortResponseDragAndDropSortInputDirective.ts index 928edb7c3bc7..69973a2392cf 100644 --- a/extensions/interactions/DragAndDropSortInput/directives/OppiaShortResponseDragAndDropSortInputDirective.ts +++ b/extensions/interactions/DragAndDropSortInput/directives/OppiaShortResponseDragAndDropSortInputDirective.ts @@ -13,7 +13,7 @@ // limitations under the License. /** - * Directive for the DragAndDropSortInput short response. + * @fileoverview Directive for the DragAndDropSortInput short response. */ oppia.directive('oppiaShortResponseDragAndDropSortInput', [ diff --git a/extensions/interactions/EndExploration/directives/EndExplorationValidationServiceSpec.ts b/extensions/interactions/EndExploration/directives/EndExplorationValidationServiceSpec.ts index 0480ba28d8e0..dd03b58da52c 100644 --- a/extensions/interactions/EndExploration/directives/EndExplorationValidationServiceSpec.ts +++ b/extensions/interactions/EndExploration/directives/EndExplorationValidationServiceSpec.ts @@ -12,6 +12,10 @@ // See the License for the specific language governing permissions and // limitations under the License. +/** + * @fileoverview Unit tests for end exploration validation service. + */ + describe('EndExplorationValidationService', function() { var WARNING_TYPES, validatorService; diff --git a/extensions/interactions/EndExploration/directives/OppiaInteractiveEndExplorationDirective.ts b/extensions/interactions/EndExploration/directives/OppiaInteractiveEndExplorationDirective.ts index 3dfe4a720098..927194e47326 100644 --- a/extensions/interactions/EndExploration/directives/OppiaInteractiveEndExplorationDirective.ts +++ b/extensions/interactions/EndExploration/directives/OppiaInteractiveEndExplorationDirective.ts @@ -13,7 +13,7 @@ // limitations under the License. /** - * Directive for the EndExploration 'interaction'. + * @fileoverview Directive for the EndExploration 'interaction'. * * IMPORTANT NOTE: The naming convention for customization args that are passed * into the directive is: the name of the parameter, followed by 'With', diff --git a/extensions/interactions/EndExploration/directives/OppiaResponseEndExplorationDirective.ts b/extensions/interactions/EndExploration/directives/OppiaResponseEndExplorationDirective.ts index c517c49801c5..8f910b86774f 100644 --- a/extensions/interactions/EndExploration/directives/OppiaResponseEndExplorationDirective.ts +++ b/extensions/interactions/EndExploration/directives/OppiaResponseEndExplorationDirective.ts @@ -13,7 +13,7 @@ // limitations under the License. /** - * Directive for the EndExploration response. + * @fileoverview Directive for the EndExploration response. * * IMPORTANT NOTE: The naming convention for customization args that are passed * into the directive is: the name of the parameter, followed by 'With', diff --git a/extensions/interactions/EndExploration/directives/OppiaShortResponseEndExplorationDirective.ts b/extensions/interactions/EndExploration/directives/OppiaShortResponseEndExplorationDirective.ts index 31f1f711bbdf..4b59decd12f3 100644 --- a/extensions/interactions/EndExploration/directives/OppiaShortResponseEndExplorationDirective.ts +++ b/extensions/interactions/EndExploration/directives/OppiaShortResponseEndExplorationDirective.ts @@ -13,7 +13,7 @@ // limitations under the License. /** - * Directive for the EndExploration short response. + * @fileoverview Directive for the EndExploration short response. * * IMPORTANT NOTE: The naming convention for customization args that are passed * into the directive is: the name of the parameter, followed by 'With', diff --git a/extensions/interactions/FractionInput/directives/FractionInputValidationServiceSpec.ts b/extensions/interactions/FractionInput/directives/FractionInputValidationServiceSpec.ts index b7383c02dc12..5c026a5d42e1 100644 --- a/extensions/interactions/FractionInput/directives/FractionInputValidationServiceSpec.ts +++ b/extensions/interactions/FractionInput/directives/FractionInputValidationServiceSpec.ts @@ -12,6 +12,10 @@ // See the License for the specific language governing permissions and // limitations under the License. +/** + * @fileoverview Unit tests for fraction input validation service. + */ + describe('FractionInputValidationService', function() { var validatorService, WARNING_TYPES; diff --git a/extensions/interactions/FractionInput/directives/OppiaInteractiveFractionInputDirective.ts b/extensions/interactions/FractionInput/directives/OppiaInteractiveFractionInputDirective.ts index 36063f05fd62..c7c5731d6e01 100644 --- a/extensions/interactions/FractionInput/directives/OppiaInteractiveFractionInputDirective.ts +++ b/extensions/interactions/FractionInput/directives/OppiaInteractiveFractionInputDirective.ts @@ -13,7 +13,7 @@ // limitations under the License. /** - * Directive for the FractionInput interaction. + * @fileoverview Directive for the FractionInput interaction. */ oppia.directive('oppiaInteractiveFractionInput', [ diff --git a/extensions/interactions/FractionInput/directives/OppiaResponseFractionInputDirective.ts b/extensions/interactions/FractionInput/directives/OppiaResponseFractionInputDirective.ts index c94a3ac1e0f6..a3da50bc4a7a 100644 --- a/extensions/interactions/FractionInput/directives/OppiaResponseFractionInputDirective.ts +++ b/extensions/interactions/FractionInput/directives/OppiaResponseFractionInputDirective.ts @@ -13,7 +13,7 @@ // limitations under the License. /** - * Directive for the FractionInput response. + * @fileoverview Directive for the FractionInput response. */ oppia.directive('oppiaResponseFractionInput', [ diff --git a/extensions/interactions/FractionInput/directives/OppiaShortResponseFractionInputDirective.ts b/extensions/interactions/FractionInput/directives/OppiaShortResponseFractionInputDirective.ts index 8569f1cce8ad..84d010262230 100644 --- a/extensions/interactions/FractionInput/directives/OppiaShortResponseFractionInputDirective.ts +++ b/extensions/interactions/FractionInput/directives/OppiaShortResponseFractionInputDirective.ts @@ -13,7 +13,7 @@ // limitations under the License. /** - * Directive for the FractionInput short response. + * @fileoverview Directive for the FractionInput short response. */ oppia.directive('oppiaShortResponseFractionInput', [ diff --git a/extensions/interactions/GraphInput/directives/GraphInputValidationServiceSpec.ts b/extensions/interactions/GraphInput/directives/GraphInputValidationServiceSpec.ts index a8f4c2446e06..3746ca9948e5 100644 --- a/extensions/interactions/GraphInput/directives/GraphInputValidationServiceSpec.ts +++ b/extensions/interactions/GraphInput/directives/GraphInputValidationServiceSpec.ts @@ -12,6 +12,10 @@ // See the License for the specific language governing permissions and // limitations under the License. +/** + * @fileoverview Unit tests for graph input validation service. + */ + describe('GraphInputValidationService', function() { var WARNING_TYPES, validatorService; var currentState, customizationArguments, answerGroups, goodDefaultOutcome; diff --git a/extensions/interactions/GraphInput/directives/GraphVizDirective.ts b/extensions/interactions/GraphInput/directives/GraphVizDirective.ts index b3ed5f3e1523..d769244a13e6 100644 --- a/extensions/interactions/GraphInput/directives/GraphVizDirective.ts +++ b/extensions/interactions/GraphInput/directives/GraphVizDirective.ts @@ -13,7 +13,7 @@ // limitations under the License. /** - * Directive for the graph-viz. + * @fileoverview Directive for the graph-viz. * * IMPORTANT NOTE: The naming convention for customization args that are passed * into the directive is: the name of the parameter, followed by 'With', diff --git a/extensions/interactions/GraphInput/directives/OppiaInteractiveGraphInputDirective.ts b/extensions/interactions/GraphInput/directives/OppiaInteractiveGraphInputDirective.ts index 614500153a27..74233871fd47 100644 --- a/extensions/interactions/GraphInput/directives/OppiaInteractiveGraphInputDirective.ts +++ b/extensions/interactions/GraphInput/directives/OppiaInteractiveGraphInputDirective.ts @@ -13,7 +13,7 @@ // limitations under the License. /** - * Directive for the GraphInput interaction. + * @fileoverview Directive for the GraphInput interaction. * * IMPORTANT NOTE: The naming convention for customization args that are passed * into the directive is: the name of the parameter, followed by 'With', diff --git a/extensions/interactions/GraphInput/directives/OppiaResponseGraphInputDirective.ts b/extensions/interactions/GraphInput/directives/OppiaResponseGraphInputDirective.ts index 5919b4027e4c..9d5557319bf9 100644 --- a/extensions/interactions/GraphInput/directives/OppiaResponseGraphInputDirective.ts +++ b/extensions/interactions/GraphInput/directives/OppiaResponseGraphInputDirective.ts @@ -13,7 +13,7 @@ // limitations under the License. /** - * Directive for the GraphInput response. + * @fileoverview Directive for the GraphInput response. * * IMPORTANT NOTE: The naming convention for customization args that are passed * into the directive is: the name of the parameter, followed by 'With', diff --git a/extensions/interactions/GraphInput/directives/OppiaShortResponseGraphInputDirective.ts b/extensions/interactions/GraphInput/directives/OppiaShortResponseGraphInputDirective.ts index 322fcca14009..ee9cdcf98b03 100644 --- a/extensions/interactions/GraphInput/directives/OppiaShortResponseGraphInputDirective.ts +++ b/extensions/interactions/GraphInput/directives/OppiaShortResponseGraphInputDirective.ts @@ -13,7 +13,7 @@ // limitations under the License. /** - * Directive for the GraphInput short response. + * @fileoverview Directive for the GraphInput short response. * * IMPORTANT NOTE: The naming convention for customization args that are passed * into the directive is: the name of the parameter, followed by 'With', diff --git a/extensions/interactions/ImageClickInput/directives/ImageClickInputValidationServiceSpec.ts b/extensions/interactions/ImageClickInput/directives/ImageClickInputValidationServiceSpec.ts index 019540b19afd..201addff7686 100644 --- a/extensions/interactions/ImageClickInput/directives/ImageClickInputValidationServiceSpec.ts +++ b/extensions/interactions/ImageClickInput/directives/ImageClickInputValidationServiceSpec.ts @@ -12,6 +12,10 @@ // See the License for the specific language governing permissions and // limitations under the License. +/** + * @fileoverview Unit tests for image click input validation service. + */ + describe('ImageClickInputValidationService', function() { var WARNING_TYPES, validatorService; diff --git a/extensions/interactions/ImageClickInput/directives/OppiaInteractiveImageClickInputDirective.ts b/extensions/interactions/ImageClickInput/directives/OppiaInteractiveImageClickInputDirective.ts index 2fe52427b716..b7fc86901c82 100644 --- a/extensions/interactions/ImageClickInput/directives/OppiaInteractiveImageClickInputDirective.ts +++ b/extensions/interactions/ImageClickInput/directives/OppiaInteractiveImageClickInputDirective.ts @@ -13,7 +13,7 @@ // limitations under the License. /** - * Directive for the ImageClickInput interaction. + * @fileoverview Directive for the ImageClickInput interaction. * * IMPORTANT NOTE: The naming convention for customization args that are passed * into the directive is: the name of the parameter, followed by 'With', diff --git a/extensions/interactions/ImageClickInput/directives/OppiaResponseImageClickInputDirective.ts b/extensions/interactions/ImageClickInput/directives/OppiaResponseImageClickInputDirective.ts index c4ba79f9ba22..0722e0e21c6e 100644 --- a/extensions/interactions/ImageClickInput/directives/OppiaResponseImageClickInputDirective.ts +++ b/extensions/interactions/ImageClickInput/directives/OppiaResponseImageClickInputDirective.ts @@ -13,7 +13,7 @@ // limitations under the License. /** - * Directive for the ImageClickInput response. + * @fileoverview Directive for the ImageClickInput response. * * IMPORTANT NOTE: The naming convention for customization args that are passed * into the directive is: the name of the parameter, followed by 'With', diff --git a/extensions/interactions/ImageClickInput/directives/OppiaShortResponseImageClickInputDirective.ts b/extensions/interactions/ImageClickInput/directives/OppiaShortResponseImageClickInputDirective.ts index 3330d419d3e2..670f57677fc7 100644 --- a/extensions/interactions/ImageClickInput/directives/OppiaShortResponseImageClickInputDirective.ts +++ b/extensions/interactions/ImageClickInput/directives/OppiaShortResponseImageClickInputDirective.ts @@ -13,7 +13,7 @@ // limitations under the License. /** - * Directive for the ImageClickInput short response. + * @fileoverview Directive for the ImageClickInput short response. * * IMPORTANT NOTE: The naming convention for customization args that are passed * into the directive is: the name of the parameter, followed by 'With', diff --git a/extensions/interactions/InteractiveMap/directives/InteractiveMapValidationServiceSpec.ts b/extensions/interactions/InteractiveMap/directives/InteractiveMapValidationServiceSpec.ts index 6d55e1fbb3c5..0b986b5e3cb4 100644 --- a/extensions/interactions/InteractiveMap/directives/InteractiveMapValidationServiceSpec.ts +++ b/extensions/interactions/InteractiveMap/directives/InteractiveMapValidationServiceSpec.ts @@ -12,6 +12,10 @@ // See the License for the specific language governing permissions and // limitations under the License. +/** + * @fileoverview Unit tests for interactive map validation service. + */ + describe('InteractiveMapValidationService', function() { var validatorService, WARNING_TYPES; diff --git a/extensions/interactions/InteractiveMap/directives/OppiaInteractiveInteractiveMapDirective.ts b/extensions/interactions/InteractiveMap/directives/OppiaInteractiveInteractiveMapDirective.ts index e470340a017f..c70102769186 100644 --- a/extensions/interactions/InteractiveMap/directives/OppiaInteractiveInteractiveMapDirective.ts +++ b/extensions/interactions/InteractiveMap/directives/OppiaInteractiveInteractiveMapDirective.ts @@ -13,7 +13,7 @@ // limitations under the License. /** - * Directive for the InteractiveMap interaction. + * @fileoverview Directive for the InteractiveMap interaction. * * IMPORTANT NOTE: The naming convention for customization args that are passed * into the directive is: the name of the parameter, followed by 'With', diff --git a/extensions/interactions/InteractiveMap/directives/OppiaResponseInteractiveMapDirective.ts b/extensions/interactions/InteractiveMap/directives/OppiaResponseInteractiveMapDirective.ts index eb47676765cd..cf7f2f0ab6f4 100644 --- a/extensions/interactions/InteractiveMap/directives/OppiaResponseInteractiveMapDirective.ts +++ b/extensions/interactions/InteractiveMap/directives/OppiaResponseInteractiveMapDirective.ts @@ -13,7 +13,7 @@ // limitations under the License. /** - * Directive for the InteractiveMap response. + * @fileoverview Directive for the InteractiveMap response. * * IMPORTANT NOTE: The naming convention for customization args that are passed * into the directive is: the name of the parameter, followed by 'With', diff --git a/extensions/interactions/InteractiveMap/directives/OppiaShortResponseInteractiveMapDirective.ts b/extensions/interactions/InteractiveMap/directives/OppiaShortResponseInteractiveMapDirective.ts index 82ab2a50527d..56b97b908db9 100644 --- a/extensions/interactions/InteractiveMap/directives/OppiaShortResponseInteractiveMapDirective.ts +++ b/extensions/interactions/InteractiveMap/directives/OppiaShortResponseInteractiveMapDirective.ts @@ -13,7 +13,7 @@ // limitations under the License. /** - * Directive for the InteractiveMap short response. + * @fileoverview Directive for the InteractiveMap short response. * * IMPORTANT NOTE: The naming convention for customization args that are passed * into the directive is: the name of the parameter, followed by 'With', diff --git a/extensions/interactions/ItemSelectionInput/directives/ItemSelectionInputValidationServiceSpec.ts b/extensions/interactions/ItemSelectionInput/directives/ItemSelectionInputValidationServiceSpec.ts index 1ecde53d360f..8d7e04de734e 100644 --- a/extensions/interactions/ItemSelectionInput/directives/ItemSelectionInputValidationServiceSpec.ts +++ b/extensions/interactions/ItemSelectionInput/directives/ItemSelectionInputValidationServiceSpec.ts @@ -12,6 +12,10 @@ // See the License for the specific language governing permissions and // limitations under the License. +/** + * @fileoverview Unit tests for item selection input validation service. + */ + describe('ItemSelectionInputValidationService', function() { var WARNING_TYPES, validatorService; diff --git a/extensions/interactions/ItemSelectionInput/directives/OppiaInteractiveItemSelectionInputDirective.ts b/extensions/interactions/ItemSelectionInput/directives/OppiaInteractiveItemSelectionInputDirective.ts index da3370e180bc..aafb8ab06d50 100644 --- a/extensions/interactions/ItemSelectionInput/directives/OppiaInteractiveItemSelectionInputDirective.ts +++ b/extensions/interactions/ItemSelectionInput/directives/OppiaInteractiveItemSelectionInputDirective.ts @@ -13,7 +13,7 @@ // limitations under the License. /** - * Directive for the ItemSelectionInput interaction. + * @fileoverview Directive for the ItemSelectionInput interaction. * * IMPORTANT NOTE: The naming convention for customization args that are passed * into the directive is: the name of the parameter, followed by 'With', diff --git a/extensions/interactions/ItemSelectionInput/directives/OppiaResponseItemSelectionInputDirective.ts b/extensions/interactions/ItemSelectionInput/directives/OppiaResponseItemSelectionInputDirective.ts index e512b5c6ff5a..c96ba3dc5afc 100644 --- a/extensions/interactions/ItemSelectionInput/directives/OppiaResponseItemSelectionInputDirective.ts +++ b/extensions/interactions/ItemSelectionInput/directives/OppiaResponseItemSelectionInputDirective.ts @@ -13,7 +13,7 @@ // limitations under the License. /** - * Directive for the ItemSelectionInput response. + * @fileoverview Directive for the ItemSelectionInput response. * * IMPORTANT NOTE: The naming convention for customization args that are passed * into the directive is: the name of the parameter, followed by 'With', diff --git a/extensions/interactions/ItemSelectionInput/directives/OppiaShortResponseItemSelectionInputDirective.ts b/extensions/interactions/ItemSelectionInput/directives/OppiaShortResponseItemSelectionInputDirective.ts index b984dc713d6e..b3ca8b00c496 100644 --- a/extensions/interactions/ItemSelectionInput/directives/OppiaShortResponseItemSelectionInputDirective.ts +++ b/extensions/interactions/ItemSelectionInput/directives/OppiaShortResponseItemSelectionInputDirective.ts @@ -13,7 +13,7 @@ // limitations under the License. /** - * Directive for the ItemSelectionInput short response. + * @fileoverview Directive for the ItemSelectionInput short response. * * IMPORTANT NOTE: The naming convention for customization args that are passed * into the directive is: the name of the parameter, followed by 'With', diff --git a/extensions/interactions/LogicProof/directives/LogicProofValidationServiceSpec.ts b/extensions/interactions/LogicProof/directives/LogicProofValidationServiceSpec.ts index 1a4f51452681..0ae1d82e0bd5 100644 --- a/extensions/interactions/LogicProof/directives/LogicProofValidationServiceSpec.ts +++ b/extensions/interactions/LogicProof/directives/LogicProofValidationServiceSpec.ts @@ -12,6 +12,10 @@ // See the License for the specific language governing permissions and // limitations under the License. +/** + * @fileoverview Unit tests for logic proof validation service. + */ + describe('LogicProofValidationService', function() { var validatorService, WARNING_TYPES; diff --git a/extensions/interactions/LogicProof/directives/OppiaInteractiveLogicProofDirective.ts b/extensions/interactions/LogicProof/directives/OppiaInteractiveLogicProofDirective.ts index 70f40099ccea..2279c52bafe8 100644 --- a/extensions/interactions/LogicProof/directives/OppiaInteractiveLogicProofDirective.ts +++ b/extensions/interactions/LogicProof/directives/OppiaInteractiveLogicProofDirective.ts @@ -13,7 +13,7 @@ // limitations under the License. /** - * Directive for the LogicProof Interaction. + * @fileoverview Directive for the LogicProof Interaction. */ oppia.directive('oppiaInteractiveLogicProof', [ diff --git a/extensions/interactions/LogicProof/directives/OppiaResponseLogicProofDirective.ts b/extensions/interactions/LogicProof/directives/OppiaResponseLogicProofDirective.ts index dc896ddf18a2..bccdfc9d58a9 100644 --- a/extensions/interactions/LogicProof/directives/OppiaResponseLogicProofDirective.ts +++ b/extensions/interactions/LogicProof/directives/OppiaResponseLogicProofDirective.ts @@ -13,7 +13,7 @@ // limitations under the License. /** - * Directive for the LogicProof response. + * @fileoverview Directive for the LogicProof response. */ oppia.directive('oppiaResponseLogicProof', [ diff --git a/extensions/interactions/LogicProof/directives/OppiaShortResponseLogicProofDirective.ts b/extensions/interactions/LogicProof/directives/OppiaShortResponseLogicProofDirective.ts index edb1b496c18d..4a4a6e88de38 100644 --- a/extensions/interactions/LogicProof/directives/OppiaShortResponseLogicProofDirective.ts +++ b/extensions/interactions/LogicProof/directives/OppiaShortResponseLogicProofDirective.ts @@ -13,7 +13,7 @@ // limitations under the License. /** - * Directive for the LogicProof short response. + * @fileoverview Directive for the LogicProof short response. */ oppia.directive('oppiaShortResponseLogicProof', [ diff --git a/extensions/interactions/LogicProof/static/js/data.ts b/extensions/interactions/LogicProof/static/js/data.ts index c5642465ff23..cf45235d386e 100644 --- a/extensions/interactions/LogicProof/static/js/data.ts +++ b/extensions/interactions/LogicProof/static/js/data.ts @@ -12,6 +12,10 @@ // See the License for the specific language governing permissions and // limitations under the License. +/** + * @fileoverview Contains logic proof data. + */ + var logicProofData = (function() { var BASE_VOCABULARY = { from: ['from'], diff --git a/extensions/interactions/LogicProof/static/js/tools/LogicDemoTestController.ts b/extensions/interactions/LogicProof/static/js/tools/LogicDemoTestController.ts index 3b68d39282e6..f6dfa06541c3 100644 --- a/extensions/interactions/LogicProof/static/js/tools/LogicDemoTestController.ts +++ b/extensions/interactions/LogicProof/static/js/tools/LogicDemoTestController.ts @@ -12,6 +12,10 @@ // See the License for the specific language governing permissions and // limitations under the License. +/** + * @fileoverview Controller for demonstration. + */ + var logicDemo = angular.module('logicDemo', []); logicDemo.controller('LogicDemoTestController', ['$scope', function($scope) { diff --git a/extensions/interactions/LogicProof/static/js/tools/strings.ts b/extensions/interactions/LogicProof/static/js/tools/strings.ts index b9cd015df38c..2cdd2cf25caf 100644 --- a/extensions/interactions/LogicProof/static/js/tools/strings.ts +++ b/extensions/interactions/LogicProof/static/js/tools/strings.ts @@ -12,6 +12,10 @@ // See the License for the specific language governing permissions and // limitations under the License. +/** + * @fileoverview Contains predefined strings. + */ + var DEFAULT_VOCABULARY = { from: ['from'], and: ['and'], diff --git a/extensions/interactions/MathExpressionInput/directives/OppiaInteractiveMathExpressionInputDirective.ts b/extensions/interactions/MathExpressionInput/directives/OppiaInteractiveMathExpressionInputDirective.ts index f7422f7c8613..83665cef2f09 100644 --- a/extensions/interactions/MathExpressionInput/directives/OppiaInteractiveMathExpressionInputDirective.ts +++ b/extensions/interactions/MathExpressionInput/directives/OppiaInteractiveMathExpressionInputDirective.ts @@ -13,7 +13,7 @@ // limitations under the License. /** - * Directive for the MathExpressionInput interaction. + * @fileoverview Directive for the MathExpressionInput interaction. * * IMPORTANT NOTE: The naming convention for customization args that are passed * into the directive is: the name of the parameter, followed by 'With', diff --git a/extensions/interactions/MathExpressionInput/directives/OppiaResponseMathExpressionInputDirective.ts b/extensions/interactions/MathExpressionInput/directives/OppiaResponseMathExpressionInputDirective.ts index 876f4ed24cf6..c37b6b4db599 100644 --- a/extensions/interactions/MathExpressionInput/directives/OppiaResponseMathExpressionInputDirective.ts +++ b/extensions/interactions/MathExpressionInput/directives/OppiaResponseMathExpressionInputDirective.ts @@ -13,7 +13,7 @@ // limitations under the License. /** - * Directive for the MathExpressionInput response. + * @fileoverview Directive for the MathExpressionInput response. * * IMPORTANT NOTE: The naming convention for customization args that are passed * into the directive is: the name of the parameter, followed by 'With', diff --git a/extensions/interactions/MathExpressionInput/directives/OppiaShortResponseMathExpressionInputDirective.ts b/extensions/interactions/MathExpressionInput/directives/OppiaShortResponseMathExpressionInputDirective.ts index 691e7ba43e24..e99e96c5dbad 100644 --- a/extensions/interactions/MathExpressionInput/directives/OppiaShortResponseMathExpressionInputDirective.ts +++ b/extensions/interactions/MathExpressionInput/directives/OppiaShortResponseMathExpressionInputDirective.ts @@ -13,7 +13,7 @@ // limitations under the License. /** - * Directive for the MathExpressionInput short response. + * @fileoverview Directive for the MathExpressionInput short response. * * IMPORTANT NOTE: The naming convention for customization args that are passed * into the directive is: the name of the parameter, followed by 'With', diff --git a/extensions/interactions/MultipleChoiceInput/directives/MultipleChoiceInputValidationServiceSpec.ts b/extensions/interactions/MultipleChoiceInput/directives/MultipleChoiceInputValidationServiceSpec.ts index 28ab66fc49b9..b0651204019b 100644 --- a/extensions/interactions/MultipleChoiceInput/directives/MultipleChoiceInputValidationServiceSpec.ts +++ b/extensions/interactions/MultipleChoiceInput/directives/MultipleChoiceInputValidationServiceSpec.ts @@ -12,6 +12,10 @@ // See the License for the specific language governing permissions and // limitations under the License. +/** + * @fileoverview Unit tests for multiple choice input validation service. + */ + describe('MultipleChoiceInputValidationService', function() { var WARNING_TYPES; diff --git a/extensions/interactions/MultipleChoiceInput/directives/OppiaInteractiveMultipleChoiceInputDirective.ts b/extensions/interactions/MultipleChoiceInput/directives/OppiaInteractiveMultipleChoiceInputDirective.ts index c0c265ab4dc2..f3454a18f560 100644 --- a/extensions/interactions/MultipleChoiceInput/directives/OppiaInteractiveMultipleChoiceInputDirective.ts +++ b/extensions/interactions/MultipleChoiceInput/directives/OppiaInteractiveMultipleChoiceInputDirective.ts @@ -13,7 +13,7 @@ // limitations under the License. /** - * Directive for the MultipleChoiceInput interaction. + * @fileoverview Directive for the MultipleChoiceInput interaction. * * IMPORTANT NOTE: The naming convention for customization args that are passed * into the directive is: the name of the parameter, followed by 'With', diff --git a/extensions/interactions/MultipleChoiceInput/directives/OppiaResponseMultipleChoiceInputDirective.ts b/extensions/interactions/MultipleChoiceInput/directives/OppiaResponseMultipleChoiceInputDirective.ts index 113096ab2bba..46952ecddac1 100644 --- a/extensions/interactions/MultipleChoiceInput/directives/OppiaResponseMultipleChoiceInputDirective.ts +++ b/extensions/interactions/MultipleChoiceInput/directives/OppiaResponseMultipleChoiceInputDirective.ts @@ -13,7 +13,7 @@ // limitations under the License. /** - * Directive for the MultipleChoiceInput response. + * @fileoverview Directive for the MultipleChoiceInput response. * * IMPORTANT NOTE: The naming convention for customization args that are passed * into the directive is: the name of the parameter, followed by 'With', diff --git a/extensions/interactions/MultipleChoiceInput/directives/OppiaShortResponseMultipleChoiceInputDirective.ts b/extensions/interactions/MultipleChoiceInput/directives/OppiaShortResponseMultipleChoiceInputDirective.ts index 9ee7ea22e895..bf8131f68300 100644 --- a/extensions/interactions/MultipleChoiceInput/directives/OppiaShortResponseMultipleChoiceInputDirective.ts +++ b/extensions/interactions/MultipleChoiceInput/directives/OppiaShortResponseMultipleChoiceInputDirective.ts @@ -13,7 +13,7 @@ // limitations under the License. /** - * Directive for the MultipleChoiceInput short response. + * @fileoverview Directive for the MultipleChoiceInput short response. * * IMPORTANT NOTE: The naming convention for customization args that are passed * into the directive is: the name of the parameter, followed by 'With', diff --git a/extensions/interactions/MusicNotesInput/directives/MusicNotesInputValidationServiceSpec.ts b/extensions/interactions/MusicNotesInput/directives/MusicNotesInputValidationServiceSpec.ts index d1f80b22b02d..f6d0d63cfddd 100644 --- a/extensions/interactions/MusicNotesInput/directives/MusicNotesInputValidationServiceSpec.ts +++ b/extensions/interactions/MusicNotesInput/directives/MusicNotesInputValidationServiceSpec.ts @@ -12,6 +12,10 @@ // See the License for the specific language governing permissions and // limitations under the License. +/** + * @fileoverview Unit tests for music notes input validation service. + */ + describe('MusicNotesInputValidationService', function() { var validatorService, WARNING_TYPES; diff --git a/extensions/interactions/MusicNotesInput/directives/OppiaInteractiveMusicNotesInputDirective.ts b/extensions/interactions/MusicNotesInput/directives/OppiaInteractiveMusicNotesInputDirective.ts index dab019afc72f..330b9cf8a898 100644 --- a/extensions/interactions/MusicNotesInput/directives/OppiaInteractiveMusicNotesInputDirective.ts +++ b/extensions/interactions/MusicNotesInput/directives/OppiaInteractiveMusicNotesInputDirective.ts @@ -13,7 +13,7 @@ // limitations under the License. /** - * Directives for the MusicNotesInput interaction. + * @fileoverview Directives for the MusicNotesInput interaction. * * IMPORTANT NOTE: The naming convention for customization args that are passed * into the directive is: the name of the parameter, followed by 'With', diff --git a/extensions/interactions/MusicNotesInput/directives/OppiaResponseMusicNotesInputDirective.ts b/extensions/interactions/MusicNotesInput/directives/OppiaResponseMusicNotesInputDirective.ts index 09e3e820a796..a3cd1a82da27 100644 --- a/extensions/interactions/MusicNotesInput/directives/OppiaResponseMusicNotesInputDirective.ts +++ b/extensions/interactions/MusicNotesInput/directives/OppiaResponseMusicNotesInputDirective.ts @@ -13,7 +13,7 @@ // limitations under the License. /** - * Directives for the MusicNotesInput response. + * @fileoverview Directives for the MusicNotesInput response. * * IMPORTANT NOTE: The naming convention for customization args that are passed * into the directive is: the name of the parameter, followed by 'With', diff --git a/extensions/interactions/MusicNotesInput/directives/OppiaShortResponseMusicNotesInputDirective.ts b/extensions/interactions/MusicNotesInput/directives/OppiaShortResponseMusicNotesInputDirective.ts index 3ba28b423b57..966c8f171d7f 100644 --- a/extensions/interactions/MusicNotesInput/directives/OppiaShortResponseMusicNotesInputDirective.ts +++ b/extensions/interactions/MusicNotesInput/directives/OppiaShortResponseMusicNotesInputDirective.ts @@ -13,7 +13,7 @@ // limitations under the License. /** - * Directives for the MusicNotesInput short response. + * @fileoverview Directives for the MusicNotesInput short response. * * IMPORTANT NOTE: The naming convention for customization args that are passed * into the directive is: the name of the parameter, followed by 'With', diff --git a/extensions/interactions/NumberWithUnits/directives/NumberWithUnitsValidationServiceSpec.ts b/extensions/interactions/NumberWithUnits/directives/NumberWithUnitsValidationServiceSpec.ts index 32ecc47b31d9..9fc83c3cacd9 100644 --- a/extensions/interactions/NumberWithUnits/directives/NumberWithUnitsValidationServiceSpec.ts +++ b/extensions/interactions/NumberWithUnits/directives/NumberWithUnitsValidationServiceSpec.ts @@ -12,6 +12,10 @@ // See the License for the specific language governing permissions and // limitations under the License. +/** + * @fileoverview Unit tests for number with units validation service. + */ + describe('NumberWithUnitsValidationService', function() { var validatorService, WARNING_TYPES; diff --git a/extensions/interactions/NumberWithUnits/directives/OppiaInteractiveNumberWithUnitsDirective.ts b/extensions/interactions/NumberWithUnits/directives/OppiaInteractiveNumberWithUnitsDirective.ts index 831416424ed7..96fb8f3eb35c 100644 --- a/extensions/interactions/NumberWithUnits/directives/OppiaInteractiveNumberWithUnitsDirective.ts +++ b/extensions/interactions/NumberWithUnits/directives/OppiaInteractiveNumberWithUnitsDirective.ts @@ -13,7 +13,7 @@ // limitations under the License. /** - * Directive for the NumberWithUnits interaction. + * @fileoverview Directive for the NumberWithUnits interaction. */ oppia.directive('oppiaInteractiveNumberWithUnits', [ diff --git a/extensions/interactions/NumberWithUnits/directives/OppiaResponseNumberWithUnitsDirective.ts b/extensions/interactions/NumberWithUnits/directives/OppiaResponseNumberWithUnitsDirective.ts index ba5c36b72082..44d3eecd23a7 100644 --- a/extensions/interactions/NumberWithUnits/directives/OppiaResponseNumberWithUnitsDirective.ts +++ b/extensions/interactions/NumberWithUnits/directives/OppiaResponseNumberWithUnitsDirective.ts @@ -13,7 +13,7 @@ // limitations under the License. /** - * Directive for the NumberWithUnits response. + * @fileoverview Directive for the NumberWithUnits response. */ oppia.directive('oppiaResponseNumberWithUnits', [ diff --git a/extensions/interactions/NumberWithUnits/directives/OppiaShortResponseNumberWithUnitsDirective.ts b/extensions/interactions/NumberWithUnits/directives/OppiaShortResponseNumberWithUnitsDirective.ts index e24c2a7cbe5d..9b2a2079828a 100644 --- a/extensions/interactions/NumberWithUnits/directives/OppiaShortResponseNumberWithUnitsDirective.ts +++ b/extensions/interactions/NumberWithUnits/directives/OppiaShortResponseNumberWithUnitsDirective.ts @@ -13,7 +13,7 @@ // limitations under the License. /** - * Directive for the NumberWithUnits short response. + * @fileoverview Directive for the NumberWithUnits short response. */ oppia.directive('oppiaShortResponseNumberWithUnits', [ diff --git a/extensions/interactions/NumericInput/directives/NumericInputValidationServiceSpec.ts b/extensions/interactions/NumericInput/directives/NumericInputValidationServiceSpec.ts index 75cca925ecc7..d0252e434027 100644 --- a/extensions/interactions/NumericInput/directives/NumericInputValidationServiceSpec.ts +++ b/extensions/interactions/NumericInput/directives/NumericInputValidationServiceSpec.ts @@ -12,6 +12,10 @@ // See the License for the specific language governing permissions and // limitations under the License. +/** + * @fileoverview Unit tests for numeric input validation service. + */ + describe('NumericInputValidationService', function() { var validatorService, WARNING_TYPES; diff --git a/extensions/interactions/NumericInput/directives/OppiaInteractiveNumericInputDirective.ts b/extensions/interactions/NumericInput/directives/OppiaInteractiveNumericInputDirective.ts index 3e1eb81df8e5..904b039ff071 100644 --- a/extensions/interactions/NumericInput/directives/OppiaInteractiveNumericInputDirective.ts +++ b/extensions/interactions/NumericInput/directives/OppiaInteractiveNumericInputDirective.ts @@ -13,7 +13,7 @@ // limitations under the License. /** - * Directive for the NumericInput interaction. + * @fileoverview Directive for the NumericInput interaction. * * IMPORTANT NOTE: The naming convention for customization args that are passed * into the directive is: the name of the parameter, followed by 'With', diff --git a/extensions/interactions/NumericInput/directives/OppiaResponseNumericInputDirective.ts b/extensions/interactions/NumericInput/directives/OppiaResponseNumericInputDirective.ts index 24830d057362..064a6dc837f3 100644 --- a/extensions/interactions/NumericInput/directives/OppiaResponseNumericInputDirective.ts +++ b/extensions/interactions/NumericInput/directives/OppiaResponseNumericInputDirective.ts @@ -13,7 +13,7 @@ // limitations under the License. /** - * Directive for the NumericInput response. + * @fileoverview Directive for the NumericInput response. * * IMPORTANT NOTE: The naming convention for customization args that are passed * into the directive is: the name of the parameter, followed by 'With', diff --git a/extensions/interactions/NumericInput/directives/OppiaShortResponseNumericInputDirective.ts b/extensions/interactions/NumericInput/directives/OppiaShortResponseNumericInputDirective.ts index 393e3e95a94d..78ea092d08f2 100644 --- a/extensions/interactions/NumericInput/directives/OppiaShortResponseNumericInputDirective.ts +++ b/extensions/interactions/NumericInput/directives/OppiaShortResponseNumericInputDirective.ts @@ -13,7 +13,7 @@ // limitations under the License. /** - * Directive for the NumericInput short response. + * @fileoverview Directive for the NumericInput short response. * * IMPORTANT NOTE: The naming convention for customization args that are passed * into the directive is: the name of the parameter, followed by 'With', diff --git a/extensions/interactions/PencilCodeEditor/directives/OppiaInteractivePencilCodeEditorDirective.ts b/extensions/interactions/PencilCodeEditor/directives/OppiaInteractivePencilCodeEditorDirective.ts index 125e4faf56bc..ed2acfee95bb 100644 --- a/extensions/interactions/PencilCodeEditor/directives/OppiaInteractivePencilCodeEditorDirective.ts +++ b/extensions/interactions/PencilCodeEditor/directives/OppiaInteractivePencilCodeEditorDirective.ts @@ -13,7 +13,7 @@ // limitations under the License. /** - * Directive for the PencilCodeEditor interaction. + * @fileoverview Directive for the PencilCodeEditor interaction. * * IMPORTANT NOTE: The naming convention for customization args that are passed * into the directive is: the name of the parameter, followed by 'With', diff --git a/extensions/interactions/PencilCodeEditor/directives/OppiaResponsePencilCodeEditorDirective.ts b/extensions/interactions/PencilCodeEditor/directives/OppiaResponsePencilCodeEditorDirective.ts index c15324f4f019..21823d7a0f04 100644 --- a/extensions/interactions/PencilCodeEditor/directives/OppiaResponsePencilCodeEditorDirective.ts +++ b/extensions/interactions/PencilCodeEditor/directives/OppiaResponsePencilCodeEditorDirective.ts @@ -13,7 +13,7 @@ // limitations under the License. /** - * Directive for the PencilCodeEditor response. + * @fileoverview Directive for the PencilCodeEditor response. * * IMPORTANT NOTE: The naming convention for customization args that are passed * into the directive is: the name of the parameter, followed by 'With', diff --git a/extensions/interactions/PencilCodeEditor/directives/OppiaShortResponsePencilCodeEditorDirective.ts b/extensions/interactions/PencilCodeEditor/directives/OppiaShortResponsePencilCodeEditorDirective.ts index 24970319d5cd..f90a156f247a 100644 --- a/extensions/interactions/PencilCodeEditor/directives/OppiaShortResponsePencilCodeEditorDirective.ts +++ b/extensions/interactions/PencilCodeEditor/directives/OppiaShortResponsePencilCodeEditorDirective.ts @@ -13,7 +13,7 @@ // limitations under the License. /** - * Directive for the PencilCodeEditor short response. + * @fileoverview Directive for the PencilCodeEditor short response. * * IMPORTANT NOTE: The naming convention for customization args that are passed * into the directive is: the name of the parameter, followed by 'With', diff --git a/extensions/interactions/SetInput/directives/OppiaInteractiveSetInputDirective.ts b/extensions/interactions/SetInput/directives/OppiaInteractiveSetInputDirective.ts index 9ea7c0972f86..d05719f60a54 100644 --- a/extensions/interactions/SetInput/directives/OppiaInteractiveSetInputDirective.ts +++ b/extensions/interactions/SetInput/directives/OppiaInteractiveSetInputDirective.ts @@ -13,7 +13,7 @@ // limitations under the License. /** - * Directive for the SetInput interaction. + * @fileoverview Directive for the SetInput interaction. * * IMPORTANT NOTE: The naming convention for customization args that are passed * into the directive is: the name of the parameter, followed by 'With', diff --git a/extensions/interactions/SetInput/directives/OppiaResponseSetInputDirective.ts b/extensions/interactions/SetInput/directives/OppiaResponseSetInputDirective.ts index 8f74a424785b..dd9f8e3be5d7 100644 --- a/extensions/interactions/SetInput/directives/OppiaResponseSetInputDirective.ts +++ b/extensions/interactions/SetInput/directives/OppiaResponseSetInputDirective.ts @@ -13,7 +13,7 @@ // limitations under the License. /** - * Directive for the Set Input response. + * @fileoverview Directive for the Set Input response. * * IMPORTANT NOTE: The naming convention for customization args that are passed * into the directive is: the name of the parameter, followed by 'With', diff --git a/extensions/interactions/SetInput/directives/OppiaShortResponseSetInputDirective.ts b/extensions/interactions/SetInput/directives/OppiaShortResponseSetInputDirective.ts index 877dbe154432..15d94e4740f8 100644 --- a/extensions/interactions/SetInput/directives/OppiaShortResponseSetInputDirective.ts +++ b/extensions/interactions/SetInput/directives/OppiaShortResponseSetInputDirective.ts @@ -13,7 +13,7 @@ // limitations under the License. /** - * Directive for the Set Input short response. + * @fileoverview Directive for the Set Input short response. * * IMPORTANT NOTE: The naming convention for customization args that are passed * into the directive is: the name of the parameter, followed by 'With', diff --git a/extensions/interactions/SetInput/directives/SetInputValidationServiceSpec.ts b/extensions/interactions/SetInput/directives/SetInputValidationServiceSpec.ts index a8904b09578f..d4e20509cb2f 100644 --- a/extensions/interactions/SetInput/directives/SetInputValidationServiceSpec.ts +++ b/extensions/interactions/SetInput/directives/SetInputValidationServiceSpec.ts @@ -12,6 +12,10 @@ // See the License for the specific language governing permissions and // limitations under the License. +/** + * @fileoverview Unit tests for set input validation service. + */ + describe('SetInputValidationService', function() { var validatorService, WARNING_TYPES; diff --git a/extensions/interactions/TextInput/TextInputPredictionService.ts b/extensions/interactions/TextInput/TextInputPredictionService.ts index 301ee52c502f..9f293c0f5505 100644 --- a/extensions/interactions/TextInput/TextInputPredictionService.ts +++ b/extensions/interactions/TextInput/TextInputPredictionService.ts @@ -13,7 +13,7 @@ // limitations under the License. /** - * TextInput interaction prediction functions. + * @fileoverview TextInput interaction prediction functions. * * IMPORTANT NOTE: The prediction function uses the classifier data * of trained model (text classifier model) for inference. These functions diff --git a/extensions/interactions/TextInput/directives/OppiaInteractiveTextInputDirective.ts b/extensions/interactions/TextInput/directives/OppiaInteractiveTextInputDirective.ts index f0fbba565552..5c60b36149ed 100644 --- a/extensions/interactions/TextInput/directives/OppiaInteractiveTextInputDirective.ts +++ b/extensions/interactions/TextInput/directives/OppiaInteractiveTextInputDirective.ts @@ -13,7 +13,7 @@ // limitations under the License. /** - * Directive for the TextInput interaction. + * @fileoverview Directive for the TextInput interaction. * * IMPORTANT NOTE: The naming convention for customization args that are passed * into the directive is: the name of the parameter, followed by 'With', diff --git a/extensions/interactions/TextInput/directives/OppiaResponseTextInputDirective.ts b/extensions/interactions/TextInput/directives/OppiaResponseTextInputDirective.ts index 5e0f0e8c3cf6..70a1429e2634 100644 --- a/extensions/interactions/TextInput/directives/OppiaResponseTextInputDirective.ts +++ b/extensions/interactions/TextInput/directives/OppiaResponseTextInputDirective.ts @@ -13,7 +13,7 @@ // limitations under the License. /** - * Directive for the TextInput response. + * @fileoverview Directive for the TextInput response. * * IMPORTANT NOTE: The naming convention for customization args that are passed * into the directive is: the name of the parameter, followed by 'With', diff --git a/extensions/interactions/TextInput/directives/OppiaShortResponseTextInputDirective.ts b/extensions/interactions/TextInput/directives/OppiaShortResponseTextInputDirective.ts index ac98793fbf7a..314297446781 100644 --- a/extensions/interactions/TextInput/directives/OppiaShortResponseTextInputDirective.ts +++ b/extensions/interactions/TextInput/directives/OppiaShortResponseTextInputDirective.ts @@ -13,7 +13,7 @@ // limitations under the License. /** - * Directive for the TextInput short response. + * @fileoverview Directive for the TextInput short response. * * IMPORTANT NOTE: The naming convention for customization args that are passed * into the directive is: the name of the parameter, followed by 'With', diff --git a/extensions/interactions/TextInput/directives/TextInputValidationServiceSpec.ts b/extensions/interactions/TextInput/directives/TextInputValidationServiceSpec.ts index 3e74a0ce8d5d..9f908cd9431c 100644 --- a/extensions/interactions/TextInput/directives/TextInputValidationServiceSpec.ts +++ b/extensions/interactions/TextInput/directives/TextInputValidationServiceSpec.ts @@ -12,6 +12,10 @@ // See the License for the specific language governing permissions and // limitations under the License. +/** + * @fileoverview Unit tests for text input validation service. + */ + describe('TextInputValidationService', function() { var validatorService, WARNING_TYPES; var INTERACTION_SPECS, customizationArgSpecs, rowsSpecs, minRows, maxRows; diff --git a/extensions/objects/templates/BooleanEditorDirective.ts b/extensions/objects/templates/BooleanEditorDirective.ts index 15b52b09b98b..2f9c36b604f0 100644 --- a/extensions/objects/templates/BooleanEditorDirective.ts +++ b/extensions/objects/templates/BooleanEditorDirective.ts @@ -12,6 +12,10 @@ // See the License for the specific language governing permissions and // limitations under the License. +/** + * @fileoverview Directive for boolean editor. + */ + // The value for this editor is always editable. oppia.directive('booleanEditor', [ diff --git a/extensions/objects/templates/CodeStringEditorDirective.ts b/extensions/objects/templates/CodeStringEditorDirective.ts index 0e534f3fb23f..04f96f66b491 100644 --- a/extensions/objects/templates/CodeStringEditorDirective.ts +++ b/extensions/objects/templates/CodeStringEditorDirective.ts @@ -12,6 +12,10 @@ // See the License for the specific language governing permissions and // limitations under the License. +/** + * @fileoverview Directive for code string editor. + */ + // Every editor directive should implement an alwaysEditable option. There // may be additional customization options for the editor that should be passed // in via initArgs. diff --git a/extensions/objects/templates/CoordTwoDimEditorDirective.ts b/extensions/objects/templates/CoordTwoDimEditorDirective.ts index bd8ccd9587a5..4c9d1e0eb6d3 100644 --- a/extensions/objects/templates/CoordTwoDimEditorDirective.ts +++ b/extensions/objects/templates/CoordTwoDimEditorDirective.ts @@ -12,6 +12,10 @@ // See the License for the specific language governing permissions and // limitations under the License. +/** + * @fileoverview Directive for coord two dim editor. + */ + oppia.directive('coordTwoDimEditor', [ 'UrlInterpolationService', 'OBJECT_EDITOR_URL_PREFIX', function(UrlInterpolationService, OBJECT_EDITOR_URL_PREFIX) { diff --git a/extensions/objects/templates/DragAndDropHtmlStringEditorDirective.ts b/extensions/objects/templates/DragAndDropHtmlStringEditorDirective.ts index 8dde45c05993..22e7463ecbb0 100644 --- a/extensions/objects/templates/DragAndDropHtmlStringEditorDirective.ts +++ b/extensions/objects/templates/DragAndDropHtmlStringEditorDirective.ts @@ -12,6 +12,9 @@ // See the License for the specific language governing permissions and // limitations under the License. +/** + * @fileoverview Directive for drag and drop HTML string editor. + */ oppia.directive('dragAndDropHtmlStringEditor', [ 'UrlInterpolationService', 'OBJECT_EDITOR_URL_PREFIX', diff --git a/extensions/objects/templates/DragAndDropPositiveIntEditorDirective.ts b/extensions/objects/templates/DragAndDropPositiveIntEditorDirective.ts index 0c32263650a5..8c3add3ac41f 100644 --- a/extensions/objects/templates/DragAndDropPositiveIntEditorDirective.ts +++ b/extensions/objects/templates/DragAndDropPositiveIntEditorDirective.ts @@ -12,6 +12,9 @@ // See the License for the specific language governing permissions and // limitations under the License. +/** + * @fileoverview Directive for drag and drop positive int editor. + */ oppia.directive('dragAndDropPositiveIntEditor', [ 'UrlInterpolationService', 'OBJECT_EDITOR_URL_PREFIX', diff --git a/extensions/objects/templates/FilepathEditorDirective.ts b/extensions/objects/templates/FilepathEditorDirective.ts index 62cce28f8e19..d5abdf16ab2c 100644 --- a/extensions/objects/templates/FilepathEditorDirective.ts +++ b/extensions/objects/templates/FilepathEditorDirective.ts @@ -12,6 +12,10 @@ // See the License for the specific language governing permissions and // limitations under the License. +/** + * @fileoverview Directive for filepath editor. + */ + // This directive can only be used in the context of an exploration. oppia.directive('filepathEditor', [ diff --git a/extensions/objects/templates/FractionEditorDirective.ts b/extensions/objects/templates/FractionEditorDirective.ts index 6e6b31d78375..e7949d958729 100644 --- a/extensions/objects/templates/FractionEditorDirective.ts +++ b/extensions/objects/templates/FractionEditorDirective.ts @@ -12,6 +12,9 @@ // See the License for the specific language governing permissions and // limitations under the License. +/** + * @fileoverview Directive for fraction editor. + */ oppia.directive('fractionEditor', [ 'FractionObjectFactory', 'UrlInterpolationService', diff --git a/extensions/objects/templates/GraphEditorDirective.ts b/extensions/objects/templates/GraphEditorDirective.ts index 2968da3a5cc3..7b45ee7955a6 100644 --- a/extensions/objects/templates/GraphEditorDirective.ts +++ b/extensions/objects/templates/GraphEditorDirective.ts @@ -12,6 +12,10 @@ // See the License for the specific language governing permissions and // limitations under the License. +/** + * @fileoverview Directive for graph editor. + */ + // Every editor directive should implement an alwaysEditable option. There // may be additional customization options for the editor that should be passed // in via initArgs. diff --git a/extensions/objects/templates/GraphPropertyEditorDirective.ts b/extensions/objects/templates/GraphPropertyEditorDirective.ts index a72f7f323ecd..ecefa49b8259 100644 --- a/extensions/objects/templates/GraphPropertyEditorDirective.ts +++ b/extensions/objects/templates/GraphPropertyEditorDirective.ts @@ -13,6 +13,10 @@ // See the License for the specific language governing permissions and // limitations under the License. +/** + * @fileoverview Directive for graph property editor. + */ + // Every editor directive should implement an alwaysEditable option. There // may be additional customization options for the editor that should be passed // in via initArgs. diff --git a/extensions/objects/templates/HtmlEditorDirective.ts b/extensions/objects/templates/HtmlEditorDirective.ts index dc618de8adcb..e6aba78700ba 100644 --- a/extensions/objects/templates/HtmlEditorDirective.ts +++ b/extensions/objects/templates/HtmlEditorDirective.ts @@ -12,6 +12,10 @@ // See the License for the specific language governing permissions and // limitations under the License. +/** + * @fileoverview Directive for HTML editor. + */ + // Every editor directive should implement an alwaysEditable option. There // may be additional customization options for the editor that should be passed // in via initArgs. diff --git a/extensions/objects/templates/ImageWithRegionsEditorDirective.ts b/extensions/objects/templates/ImageWithRegionsEditorDirective.ts index a02edb945624..693428396104 100644 --- a/extensions/objects/templates/ImageWithRegionsEditorDirective.ts +++ b/extensions/objects/templates/ImageWithRegionsEditorDirective.ts @@ -12,6 +12,10 @@ // See the License for the specific language governing permissions and // limitations under the License. +/** + * @fileoverview Directive for image with regions editor. + */ + // Every editor directive should implement an alwaysEditable option. There // may be additional customization options for the editor that should be passed // in via initArgs. diff --git a/extensions/objects/templates/IntEditorDirective.ts b/extensions/objects/templates/IntEditorDirective.ts index 6279a23029ab..36f375a3e1ef 100644 --- a/extensions/objects/templates/IntEditorDirective.ts +++ b/extensions/objects/templates/IntEditorDirective.ts @@ -12,6 +12,10 @@ // See the License for the specific language governing permissions and // limitations under the License. +/** + * @fileoverview Directive for int editor. + */ + // Every editor directive should implement an alwaysEditable option. There // may be additional customization options for the editor that should be passed // in via initArgs. diff --git a/extensions/objects/templates/ListOfSetsOfHtmlStringsEditorDirective.ts b/extensions/objects/templates/ListOfSetsOfHtmlStringsEditorDirective.ts index 067f70b1ee3d..fe2efcfaf101 100644 --- a/extensions/objects/templates/ListOfSetsOfHtmlStringsEditorDirective.ts +++ b/extensions/objects/templates/ListOfSetsOfHtmlStringsEditorDirective.ts @@ -12,6 +12,9 @@ // See the License for the specific language governing permissions and // limitations under the License. +/** + * @fileoverview Directive for list of sets of html strings editor. + */ oppia.directive('listOfSetsOfHtmlStringsEditor', [ 'UrlInterpolationService', 'OBJECT_EDITOR_URL_PREFIX', diff --git a/extensions/objects/templates/ListOfTabsEditorDirective.ts b/extensions/objects/templates/ListOfTabsEditorDirective.ts index 0222b4e5530f..e8284506458e 100644 --- a/extensions/objects/templates/ListOfTabsEditorDirective.ts +++ b/extensions/objects/templates/ListOfTabsEditorDirective.ts @@ -12,6 +12,10 @@ // See the License for the specific language governing permissions and // limitations under the License. +/** + * @fileoverview Directive for list of tabs editor. + */ + // Every editor directive should implement an alwaysEditable option. There // may be additional customization options for the editor that should be passed // in via initArgs. diff --git a/extensions/objects/templates/ListOfUnicodeStringEditorDirective.ts b/extensions/objects/templates/ListOfUnicodeStringEditorDirective.ts index 59875679b020..b2891c35a8b2 100644 --- a/extensions/objects/templates/ListOfUnicodeStringEditorDirective.ts +++ b/extensions/objects/templates/ListOfUnicodeStringEditorDirective.ts @@ -12,6 +12,10 @@ // See the License for the specific language governing permissions and // limitations under the License. +/** + * @fileoverview Directive for list of unicode string editor. + */ + // Every editor directive should implement an alwaysEditable option. There // may be additional customization options for the editor that should be passed // in via initArgs. diff --git a/extensions/objects/templates/LogicErrorCategoryEditorDirective.ts b/extensions/objects/templates/LogicErrorCategoryEditorDirective.ts index 9f1f529e0482..de85b4f16677 100644 --- a/extensions/objects/templates/LogicErrorCategoryEditorDirective.ts +++ b/extensions/objects/templates/LogicErrorCategoryEditorDirective.ts @@ -12,6 +12,10 @@ // See the License for the specific language governing permissions and // limitations under the License. +/** + * @fileoverview Directive for logic error category editor. + */ + // Every editor directive should implement an alwaysEditable option. There // may be additional customization options for the editor that should be passed // in via initArgs. diff --git a/extensions/objects/templates/LogicQuestionEditorDirective.ts b/extensions/objects/templates/LogicQuestionEditorDirective.ts index 8b8489bbb6b6..4c9b95033c07 100644 --- a/extensions/objects/templates/LogicQuestionEditorDirective.ts +++ b/extensions/objects/templates/LogicQuestionEditorDirective.ts @@ -12,6 +12,10 @@ // See the License for the specific language governing permissions and // limitations under the License. +/** + * @fileoverview Directive for logic question editor. + */ + // Every editor directive should implement an alwaysEditable option. There // may be additional customization options for the editor that should be passed // in via initArgs. diff --git a/extensions/objects/templates/MathLatexStringEditorDirective.ts b/extensions/objects/templates/MathLatexStringEditorDirective.ts index 067aebd4f1f4..43c443bde347 100644 --- a/extensions/objects/templates/MathLatexStringEditorDirective.ts +++ b/extensions/objects/templates/MathLatexStringEditorDirective.ts @@ -12,6 +12,10 @@ // See the License for the specific language governing permissions and // limitations under the License. +/** + * @fileoverview Directive for math latex string editor. + */ + // Every editor directive should implement an alwaysEditable option. There // may be additional customization options for the editor that should be passed // in via initArgs. diff --git a/extensions/objects/templates/MusicPhraseEditorDirective.ts b/extensions/objects/templates/MusicPhraseEditorDirective.ts index 03dfe8626885..8267a3b5b9aa 100644 --- a/extensions/objects/templates/MusicPhraseEditorDirective.ts +++ b/extensions/objects/templates/MusicPhraseEditorDirective.ts @@ -12,6 +12,10 @@ // See the License for the specific language governing permissions and // limitations under the License. +/** + * @fileoverview Directive for music phrase editor. + */ + // This directive is always editable. oppia.directive('musicPhraseEditor', [ diff --git a/extensions/objects/templates/NonnegativeIntEditorDirective.ts b/extensions/objects/templates/NonnegativeIntEditorDirective.ts index 7d2b69b6dc84..2542b4e78ff3 100644 --- a/extensions/objects/templates/NonnegativeIntEditorDirective.ts +++ b/extensions/objects/templates/NonnegativeIntEditorDirective.ts @@ -12,6 +12,10 @@ // See the License for the specific language governing permissions and // limitations under the License. +/** + * @fileoverview Directive for non negative int editor. + */ + // Every editor directive should implement an alwaysEditable option. There // may be additional customization options for the editor that should be passed // in via initArgs. diff --git a/extensions/objects/templates/NormalizedStringEditorDirective.ts b/extensions/objects/templates/NormalizedStringEditorDirective.ts index 21600dc34110..a7f9fc93a9a9 100644 --- a/extensions/objects/templates/NormalizedStringEditorDirective.ts +++ b/extensions/objects/templates/NormalizedStringEditorDirective.ts @@ -12,6 +12,10 @@ // See the License for the specific language governing permissions and // limitations under the License. +/** + * @fileoverview Directive for normalized string editor. + */ + // This is a copy of the UnicodeStringEditor. oppia.directive('normalizedStringEditor', [ diff --git a/extensions/objects/templates/NumberWithUnitsEditorDirective.ts b/extensions/objects/templates/NumberWithUnitsEditorDirective.ts index 2c8acc28ef9c..5f790022133e 100644 --- a/extensions/objects/templates/NumberWithUnitsEditorDirective.ts +++ b/extensions/objects/templates/NumberWithUnitsEditorDirective.ts @@ -12,6 +12,9 @@ // See the License for the specific language governing permissions and // limitations under the License. +/** + * @fileoverview Directive for number with units editor. + */ oppia.directive('numberWithUnitsEditor', [ 'NumberWithUnitsObjectFactory', 'UrlInterpolationService', diff --git a/extensions/objects/templates/ParameterNameEditorDirective.ts b/extensions/objects/templates/ParameterNameEditorDirective.ts index e865dac828b6..e06dbbe4a2ee 100644 --- a/extensions/objects/templates/ParameterNameEditorDirective.ts +++ b/extensions/objects/templates/ParameterNameEditorDirective.ts @@ -12,6 +12,10 @@ // See the License for the specific language governing permissions and // limitations under the License. +/** + * @fileoverview Directive for parameter name editor. + */ + // NOTE TO DEVELOPERS: This editor requires ExplorationParamSpecsService to be // available in the context in which it is used. diff --git a/extensions/objects/templates/RealEditorDirective.ts b/extensions/objects/templates/RealEditorDirective.ts index f1a77fbdc4f9..1eb45f7edb0b 100644 --- a/extensions/objects/templates/RealEditorDirective.ts +++ b/extensions/objects/templates/RealEditorDirective.ts @@ -12,6 +12,10 @@ // See the License for the specific language governing permissions and // limitations under the License. +/** + * @fileoverview Directive for real editor. + */ + oppia.directive('realEditor', [ 'UrlInterpolationService', 'OBJECT_EDITOR_URL_PREFIX', function(UrlInterpolationService, OBJECT_EDITOR_URL_PREFIX) { diff --git a/extensions/objects/templates/SanitizedUrlEditorDirective.ts b/extensions/objects/templates/SanitizedUrlEditorDirective.ts index 8f4a297b31dd..5077bfcc88bb 100644 --- a/extensions/objects/templates/SanitizedUrlEditorDirective.ts +++ b/extensions/objects/templates/SanitizedUrlEditorDirective.ts @@ -12,6 +12,10 @@ // See the License for the specific language governing permissions and // limitations under the License. +/** + * @fileoverview Directive for sanitized URL editor. + */ + oppia.directive('sanitizedUrlEditor', [ 'UrlInterpolationService', 'OBJECT_EDITOR_URL_PREFIX', function(UrlInterpolationService, OBJECT_EDITOR_URL_PREFIX) { diff --git a/extensions/objects/templates/SetOfHtmlStringEditorDirective.ts b/extensions/objects/templates/SetOfHtmlStringEditorDirective.ts index 1341d16c5572..8d6d38f22ccf 100644 --- a/extensions/objects/templates/SetOfHtmlStringEditorDirective.ts +++ b/extensions/objects/templates/SetOfHtmlStringEditorDirective.ts @@ -12,6 +12,10 @@ // See the License for the specific language governing permissions and // limitations under the License. +/** + * @fileoverview Directive for set of HTML string editor. + */ + // Every editor directive should implement an alwaysEditable option. There // may be additional customization options for the editor that should be passed // in via initArgs. diff --git a/extensions/objects/templates/SetOfUnicodeStringEditorDirective.ts b/extensions/objects/templates/SetOfUnicodeStringEditorDirective.ts index efce4e20f58b..fcc774c2d20f 100644 --- a/extensions/objects/templates/SetOfUnicodeStringEditorDirective.ts +++ b/extensions/objects/templates/SetOfUnicodeStringEditorDirective.ts @@ -12,6 +12,10 @@ // See the License for the specific language governing permissions and // limitations under the License. +/** + * @fileoverview Directive for set of unicode string editor. + */ + // Every editor directive should implement an alwaysEditable option. There // may be additional customization options for the editor that should be passed // in via initArgs. diff --git a/extensions/objects/templates/UnicodeStringEditorDirective.ts b/extensions/objects/templates/UnicodeStringEditorDirective.ts index 268105c5f31c..603fa6a4bd99 100644 --- a/extensions/objects/templates/UnicodeStringEditorDirective.ts +++ b/extensions/objects/templates/UnicodeStringEditorDirective.ts @@ -12,6 +12,10 @@ // See the License for the specific language governing permissions and // limitations under the License. +/** + * @fileoverview Directive for unicode string editor. + */ + // Every editor directive should implement an alwaysEditable option. There // may be additional customization options for the editor that should be passed // in via initArgs. diff --git a/extensions/rich_text_components/Collapsible/directives/OppiaNoninteractiveCollapsibleDirective.ts b/extensions/rich_text_components/Collapsible/directives/OppiaNoninteractiveCollapsibleDirective.ts index df84d438c83d..f48db5a0d7e3 100644 --- a/extensions/rich_text_components/Collapsible/directives/OppiaNoninteractiveCollapsibleDirective.ts +++ b/extensions/rich_text_components/Collapsible/directives/OppiaNoninteractiveCollapsibleDirective.ts @@ -13,7 +13,7 @@ // limitations under the License. /** - * Directive for the Collapsible rich-text component. + * @fileoverview Directive for the Collapsible rich-text component. * * IMPORTANT NOTE: The naming convention for customization args that are passed * into the directive is: the name of the parameter, followed by 'With', diff --git a/extensions/rich_text_components/Image/directives/OppiaNoninteractiveImageDirective.ts b/extensions/rich_text_components/Image/directives/OppiaNoninteractiveImageDirective.ts index a146e5ed426e..1f6f837fe85d 100644 --- a/extensions/rich_text_components/Image/directives/OppiaNoninteractiveImageDirective.ts +++ b/extensions/rich_text_components/Image/directives/OppiaNoninteractiveImageDirective.ts @@ -13,7 +13,7 @@ // limitations under the License. /** - * Directive for the Image rich-text component. + * @fileoverview Directive for the Image rich-text component. * * IMPORTANT NOTE: The naming convention for customization args that are passed * into the directive is: the name of the parameter, followed by 'With', diff --git a/extensions/rich_text_components/Link/directives/OppiaNoninteractiveLinkDirective.ts b/extensions/rich_text_components/Link/directives/OppiaNoninteractiveLinkDirective.ts index 85465f6f660a..b2a5ca6981c3 100644 --- a/extensions/rich_text_components/Link/directives/OppiaNoninteractiveLinkDirective.ts +++ b/extensions/rich_text_components/Link/directives/OppiaNoninteractiveLinkDirective.ts @@ -13,7 +13,7 @@ // limitations under the License. /** - * Directive for the Link rich-text component. + * @fileoverview Directive for the Link rich-text component. * * IMPORTANT NOTE: The naming convention for customization args that are passed * into the directive is: the name of the parameter, followed by 'With', diff --git a/extensions/rich_text_components/Math/directives/OppiaNoninteractiveMathDirective.ts b/extensions/rich_text_components/Math/directives/OppiaNoninteractiveMathDirective.ts index 31b10506d434..7078734cfebd 100644 --- a/extensions/rich_text_components/Math/directives/OppiaNoninteractiveMathDirective.ts +++ b/extensions/rich_text_components/Math/directives/OppiaNoninteractiveMathDirective.ts @@ -13,7 +13,7 @@ // limitations under the License. /** - * Directive for the Math rich-text component. + * @fileoverview Directive for the Math rich-text component. * * IMPORTANT NOTE: The naming convention for customization args that are passed * into the directive is: the name of the parameter, followed by 'With', diff --git a/extensions/rich_text_components/Tabs/directives/OppiaNoninteractiveTabsDirective.ts b/extensions/rich_text_components/Tabs/directives/OppiaNoninteractiveTabsDirective.ts index 769a8d893b3d..c5abbd70adba 100644 --- a/extensions/rich_text_components/Tabs/directives/OppiaNoninteractiveTabsDirective.ts +++ b/extensions/rich_text_components/Tabs/directives/OppiaNoninteractiveTabsDirective.ts @@ -13,7 +13,7 @@ // limitations under the License. /** - * Directive for the Tabs rich-text component. + * @fileoverview Directive for the Tabs rich-text component. * * IMPORTANT NOTE: The naming convention for customization args that are passed * into the directive is: the name of the parameter, followed by 'With', diff --git a/extensions/rich_text_components/Video/directives/OppiaNoninteractiveVideoDirective.ts b/extensions/rich_text_components/Video/directives/OppiaNoninteractiveVideoDirective.ts index dc34506957b3..c1897a39be72 100644 --- a/extensions/rich_text_components/Video/directives/OppiaNoninteractiveVideoDirective.ts +++ b/extensions/rich_text_components/Video/directives/OppiaNoninteractiveVideoDirective.ts @@ -13,7 +13,7 @@ // limitations under the License. /** - * Directive for the Video rich-text component. + * @fileoverview Directive for the Video rich-text component. * * IMPORTANT NOTE: The naming convention for customization args that are passed * into the directive is: the name of the parameter, followed by 'With', diff --git a/extensions/value_generators/templates/CopierDirective.ts b/extensions/value_generators/templates/CopierDirective.ts index 3a2d470c4577..7eb771e924e5 100644 --- a/extensions/value_generators/templates/CopierDirective.ts +++ b/extensions/value_generators/templates/CopierDirective.ts @@ -12,6 +12,10 @@ // See the License for the specific language governing permissions and // limitations under the License. +/** + * @fileoverview Directive for copier value generator. + */ + // TODO(sll): Remove this directive (as well as the whole of the value // generators framework). diff --git a/extensions/value_generators/templates/RandomSelectorDirective.ts b/extensions/value_generators/templates/RandomSelectorDirective.ts index 403385c3bea2..4b5ceb969428 100644 --- a/extensions/value_generators/templates/RandomSelectorDirective.ts +++ b/extensions/value_generators/templates/RandomSelectorDirective.ts @@ -12,6 +12,10 @@ // See the License for the specific language governing permissions and // limitations under the License. +/** + * @fileoverview Directive for random selector value generator. + */ + oppia.directive('randomSelector', ['$compile', function($compile) { return { link: function(scope: ICustomScope, element) { diff --git a/scripts/pre_commit_linter.py b/scripts/pre_commit_linter.py index 42ed4ba22564..c5efbb00753b 100644 --- a/scripts/pre_commit_linter.py +++ b/scripts/pre_commit_linter.py @@ -89,6 +89,29 @@ help='verbose mode. All details will be printed.', action='store_true') +EXCLUDED_PHRASES = [ + 'utf', 'pylint:', 'http://', 'https://', 'scripts/', 'extract_node'] + +EXCLUDED_PATHS = ( + 'third_party/*', 'build/*', '.git/*', '*.pyc', 'CHANGELOG', + 'integrations/*', 'integrations_dev/*', '*.svg', '*.gif', + '*.png', '*.zip', '*.ico', '*.jpg', '*.min.js', + 'assets/scripts/*', 'core/tests/data/*', 'core/tests/build_sources/*', + '*.mp3', '*.mp4', 'node_modules/*', 'typings/*', 'local_compiled_js/*') + +GENERATED_FILE_PATHS = ( + 'extensions/interactions/LogicProof/static/js/generatedDefaultData.js', + 'extensions/interactions/LogicProof/static/js/generatedParser.js', + 'core/templates/dev/head/expressions/ExpressionParserService.js') + +CONFIG_FILE_PATHS = ( + 'core/tests/.browserstack.env.example', + 'core/tests/protractor.conf.js', + 'core/tests/karma.conf.ts', + 'core/templates/dev/head/mathjaxConfig.ts', + 'assets/constants.js', + 'assets/rich_text_components_definitions.js') + BAD_PATTERNS = { '__author__': { 'message': 'Please remove author tags from this file.', @@ -191,6 +214,29 @@ }, ] +MANDATORY_PATTERNS_REGEXP = [ + { + 'regexp': r'Copyright \d{4} The Oppia Authors\. All Rights Reserved\.', + 'message': 'Please ensure this file should contain a proper ' + 'copyright notice.', + 'included_types': ('.py', '.js', '.sh', '.ts'), + 'excluded_files': GENERATED_FILE_PATHS + CONFIG_FILE_PATHS + ( + '__init__.py', ), + 'excluded_dirs': EXCLUDED_PATHS + } +] + +MANDATORY_PATTERNS_JS_REGEXP = [ + { + 'regexp': r'^\s\*\s@fileoverview\s[a-zA-Z0-9_]+', + 'message': 'Please ensure this file should contain a file ' + 'overview i.e. a short description of the file.', + 'included_types': ('.js', '.ts'), + 'excluded_files': GENERATED_FILE_PATHS + CONFIG_FILE_PATHS, + 'excluded_dirs': EXCLUDED_PATHS + } +] + BAD_LINE_PATTERNS_HTML_REGEXP = [ { 'regexp': r'text\/ng-template', @@ -1049,7 +1095,7 @@ def _validate_and_parse_js_and_ts_files(self): try: # Use esprima to parse a JS or TS file. parsed_js_and_ts_files[filepath] = esprima.parseScript( - file_content) + file_content, comment=True) except Exception as e: # Compile typescript file which has syntax not valid for JS # file. @@ -1422,6 +1468,84 @@ def _check_js_and_ts_component_name_and_count(self): print '' return summary_messages + def _check_for_mandatory_pattern_in_file( + self, pattern_list, filepath, failed): + """Checks for a given mandatory pattern in a file. + + Args: + pattern_list: list(dict). The list of the mandatory patterns list to + be checked for in the file. + filepath: str. The path to the file to be linted. + failed: bool. Status of failure of the check. + + Returns: + bool. The failure status of the check. + """ + # This boolean list keeps track of the regex matches + # found in the file. + pattern_found_list = [] + file_content = FileCache.readlines(filepath) + for index, regexp_to_check in enumerate( + pattern_list): + if (any([filepath.endswith( + allowed_type) for allowed_type in ( + regexp_to_check['included_types'])]) and ( + not any([ + filepath.endswith( + pattern) for pattern in ( + regexp_to_check[ + 'excluded_files'] + + regexp_to_check[ + 'excluded_dirs'])]))): + pattern_found_list.append(False) + for line in file_content: + if re.search(regexp_to_check['regexp'], line): + pattern_found_list[index] = True + break + if not all(pattern_found_list): + failed = True + for index, pattern_found in enumerate( + pattern_found_list): + if not pattern_found: + print '%s --> %s' % ( + filepath, + pattern_list[index]['message']) + return failed + + def _check_mandatory_patterns(self): + """This function checks that all files contain the mandatory + patterns. + """ + if self.verbose_mode_enabled: + print 'Starting mandatory patterns check' + print '----------------------------------------' + + summary_messages = [] + failed = False + + with _redirect_stdout(_TARGET_STDOUT): + sets_of_patterns_to_match = [ + MANDATORY_PATTERNS_REGEXP, MANDATORY_PATTERNS_JS_REGEXP] + for filepath in self.all_filepaths: + for pattern_list in sets_of_patterns_to_match: + failed = self._check_for_mandatory_pattern_in_file( + pattern_list, filepath, failed) + + if failed: + summary_message = ( + '%s Mandatory pattern check failed' % ( + _MESSAGE_TYPE_FAILED)) + else: + summary_message = ( + '%s Mandatory pattern check passed' % ( + _MESSAGE_TYPE_SUCCESS)) + print summary_message + + print '' + + summary_messages.append(summary_message) + return summary_messages + def _check_sorted_dependencies(self): """This function checks that the dependencies which are imported in the controllers/directives/factories in JS @@ -2091,62 +2215,6 @@ def _check_bad_patterns(self): return summary_messages - def _check_for_copyright_notice(self): - """This function checks whether the copyright notice - is present at the beginning of files. - """ - if self.verbose_mode_enabled: - print 'Starting copyright notice check' - print '----------------------------------------' - js_and_ts_files_to_check = [ - filepath for filepath in self.all_filepaths if filepath.endswith(( - '.js', '.ts')) and ( - not filepath.endswith(GENERATED_FILE_PATHS)) and ( - not filepath.endswith(CONFIG_FILE_PATHS))] - py_files_to_check = [ - filepath for filepath in self.all_filepaths if filepath.endswith( - '.py') and (not filepath.endswith('__init__.py'))] - sh_files_to_check = [ - filepath for filepath in self.all_filepaths if filepath.endswith( - '.sh')] - all_files_to_check = ( - js_and_ts_files_to_check + py_files_to_check + sh_files_to_check) - regexp_to_check = ( - r'Copyright \d{4} The Oppia Authors\. All Rights Reserved\.') - - failed = False - summary_messages = [] - - with _redirect_stdout(_TARGET_STDOUT): - for filepath in all_files_to_check: - has_copyright_notice = False - for line in FileCache.readlines(filepath)[:5]: - if re.search(regexp_to_check, line): - has_copyright_notice = True - break - - if not has_copyright_notice: - failed = True - print ( - '%s --> Please add a proper copyright notice to this ' - 'file.' % (filepath)) - print '' - - if failed: - summary_message = '%s Copyright notice check failed' % ( - _MESSAGE_TYPE_FAILED) - print summary_message - summary_messages.append(summary_message) - else: - summary_message = '%s Copyright notice check passed' % ( - _MESSAGE_TYPE_SUCCESS) - print summary_message - summary_messages.append(summary_message) - - print '' - - return summary_messages - def _check_codeowner_file(self): """Checks the CODEOWNERS file for any uncovered dirs/files and also checks that every pattern in the CODEOWNERS file matches at least one @@ -2259,6 +2327,7 @@ def perform_all_lint_checks(self): js_and_ts_component_messages = ( self._check_js_and_ts_component_name_and_count()) directive_scope_messages = self._check_directive_scope() + mandatory_patterns_messages = self._check_mandatory_patterns() sorted_dependencies_messages = ( self._check_sorted_dependencies()) controller_dependency_messages = ( @@ -2274,17 +2343,15 @@ def perform_all_lint_checks(self): self._check_html_tags_and_attributes()) html_linter_messages = self._lint_html_files() pattern_messages = self._check_bad_patterns() - copyright_notice_messages = ( - self._check_for_copyright_notice()) codeowner_messages = self._check_codeowner_file() all_messages = ( js_and_ts_component_messages + directive_scope_messages + sorted_dependencies_messages + controller_dependency_messages + html_directive_name_messages + import_order_messages + - docstring_messages + comment_messages + - html_tag_and_attribute_messages + + mandatory_patterns_messages + docstring_messages + + comment_messages + html_tag_and_attribute_messages + html_linter_messages + linter_messages + pattern_messages + - copyright_notice_messages + codeowner_messages) + codeowner_messages) return all_messages diff --git a/webpack.config.ts b/webpack.config.ts index b14b306ff59f..d1efdacb2e7b 100644 --- a/webpack.config.ts +++ b/webpack.config.ts @@ -12,6 +12,10 @@ // See the License for the specific language governing permissions and // limitations under the License. +/** + * @fileoverview General config file for Webpack. + */ + var CleanWebpackPlugin = require('clean-webpack-plugin'); var ForkTsCheckerWebpackPlugin = require('fork-ts-checker-webpack-plugin'); var HtmlWebpackPlugin = require('html-webpack-plugin'); diff --git a/webpack.dev.config.ts b/webpack.dev.config.ts index 2d202ae2cf9c..a24dc97d417c 100644 --- a/webpack.dev.config.ts +++ b/webpack.dev.config.ts @@ -12,6 +12,9 @@ // See the License for the specific language governing permissions and // limitations under the License. +/** + * @fileoverview Dev environment config file for Webpack. + */ var commonWebpackConfig = require('./webpack.config.ts'); var path = require('path'); diff --git a/webpack.prod.config.ts b/webpack.prod.config.ts index 7c268bca3f33..48a9ec7197f9 100644 --- a/webpack.prod.config.ts +++ b/webpack.prod.config.ts @@ -12,6 +12,9 @@ // See the License for the specific language governing permissions and // limitations under the License. +/** + * @fileoverview Production environment config file for Webpack. + */ var commonWebpackConfig = require('./webpack.config.ts'); var path = require('path');