Skip to content

Commit

Permalink
Fix oppia#6364: Added file overview check. (oppia#6451)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
YashJipkate authored and seanlip committed May 24, 2019
1 parent 2b29b50 commit 51f63c9
Show file tree
Hide file tree
Showing 163 changed files with 530 additions and 183 deletions.
5 changes: 5 additions & 0 deletions assets/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
5 changes: 5 additions & 0 deletions assets/rich_text_components_definitions.js
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
4 changes: 4 additions & 0 deletions core/templates/dev/head/AppInit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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', [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
// limitations under the License.

/**
* @fileoverview Unit tests for ParamMetadataObjectFactory.
*/
* @fileoverview Unit tests for ParamMetadataObjectFactory.
*/

require('domain/exploration/ParamMetadataObjectFactory.ts');

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
// limitations under the License.

/**
* @fileoverview Unit tests for FeedbackThreadObjectFactory.
*/
* @fileoverview Unit tests for FeedbackThreadObjectFactory.
*/

require('domain/feedback_thread/FeedbackThreadObjectFactory.ts');

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
// limitations under the License.

/**
* @fileoverview Unit tests for MisconceptionObjectFacfory.
*/
* @fileoverview Unit tests for MisconceptionObjectFacfory.
*/

require('domain/skill/MisconceptionObjectFactory.ts');

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down
4 changes: 2 additions & 2 deletions core/templates/dev/head/domain/skill/SkillUpdateService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
// limitations under the License.

/**
* @fileoverview Unit tests for SuggestionObjectFactory.
*/
* @fileoverview Unit tests for SuggestionObjectFactory.
*/

require('domain/suggestion/SuggestionObjectFactory.ts');

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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');

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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', [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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');

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down
4 changes: 4 additions & 0 deletions core/templates/dev/head/pages/contact/Contact.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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');

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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');

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down
4 changes: 4 additions & 0 deletions core/templates/dev/head/pages/get_started/GetStarted.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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');
4 changes: 2 additions & 2 deletions core/templates/dev/head/pages/moderator/Moderator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 4 additions & 0 deletions core/templates/dev/head/pages/preferences/PreferencesSpec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down
4 changes: 4 additions & 0 deletions core/templates/dev/head/services/AutoplayedVideosService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions core/templates/dev/head/services/DateTimeFormatService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
Loading

0 comments on commit 51f63c9

Please sign in to comment.