Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Code clean-up #3

Open
1 of 4 tasks
pietercolpaert opened this issue Jul 21, 2016 · 1 comment
Open
1 of 4 tasks

Code clean-up #3

pietercolpaert opened this issue Jul 21, 2016 · 1 comment
Assignees

Comments

@pietercolpaert
Copy link
Member

pietercolpaert commented Jul 21, 2016

The script works, time to clean it up:

  • Return an error when the HTTP resource could not be downloaded
  • add a parameter to get a serialization of choice
  • test whether a certain object has been set in the GTFS-RT before adding it
  • Add a lib/ folder which contains the files used by the bin file. The files in the lib folder are exposed as a library so that other projects can also start using this if they'd like

I'm planning on doing this on Friday 22d of July

@pietercolpaert pietercolpaert self-assigned this Jul 21, 2016
@Haroenv
Copy link
Member

Haroenv commented Jul 23, 2016

Related to this, I'll leave the output of xo (a opinionated JS linter) here, most of which are fixed with xo --fix :

  bin/gtfsrt2lc.js:3:1
  ✖    3:1   Split var declarations into multiple statements.                                one-var
  ✖    3:1   Do not mix core, module, file and computed requires.                            no-mixed-requires
  ✖    3:15  commander import should occur after import of fs                                import/order
  ✖    4:5   Expected indentation of 2 space characters but found 4.                         indent
  ✖    5:5   Expected indentation of 2 space characters but found 4.                         indent
  ✖    6:5   Expected indentation of 2 space characters but found 4.                         indent
  ✖    6:14  gtfs-realtime-bindings import should occur after import of fs                   import/order
  ✖    7:5   Expected indentation of 2 space characters but found 4.                         indent
  ✖    8:5   fs is defined but never used                                                    no-unused-vars
  ✖    8:5   Expected indentation of 2 space characters but found 4.                         indent
  ✖   10:2   More than 1 blank line not allowed.                                             no-multiple-empty-lines
  ✖   11:15  Strings must use singlequote.                                                   quotes
  ✖   25:1   Expected exception block, space or tab after // in comment.                     spaced-comment
  ✖   26:51  Block must not be padded by blank lines.                                        padded-blocks
  ✖   28:7   output is defined but never used                                                no-unused-vars
  ✖   34:28  Strings must use singlequote.                                                   quotes
  ✖   37:1   Trailing spaces not allowed.                                                    no-trailing-spaces
  ✖   38:7   mongoId is defined but never used                                               no-unused-vars
  ✖   40:31  Missing space before function parentheses.                                      space-before-function-paren
  ✖   40:40  Block must not be padded by blank lines.                                        padded-blocks
  ✖   43:5   Opening curly brace does not appear on the same line as controlling statement.  brace-style
  ✖   44:5   Block must not be padded by blank lines.                                        padded-blocks
  ✖   46:11  Identifier trip_update is not in camel case.                                    camelcase
  ✖   47:11  Identifier trip_id is not in camel case.                                        camelcase
  ✖   47:21  Identifier trip_update is not in camel case.                                    camelcase
  ✖   48:11  Identifier gtfs_route is not in camel case.                                     camelcase
  ✖   54:1   Trailing spaces not allowed.                                                    no-trailing-spaces
  ✖   55:2   More than 1 blank line not allowed.                                             no-multiple-empty-lines
  ✖   57:51  Opening curly brace does not appear on the same line as controlling statement.  brace-style
  ✖   57:61  Identifier stop_time is not in camel case.                                      camelcase
  ✖   58:7   Block must not be padded by blank lines.                                        padded-blocks
  ✖   60:13  Identifier stop_times_length is not in camel case.                              camelcase
  ✖   60:33  Identifier trip_update is not in camel case.                                    camelcase
  ✖   61:29  Identifier stop_time is not in camel case.                                      camelcase
  ✖   63:9   Expected space(s) after "if".                                                   keyword-spacing
  ✖   63:9   Opening curly brace does not appear on the same line as controlling statement.  brace-style
  ✖   63:9   Opening curly brace does not appear on the same line as controlling statement.  brace-style
  ✖   63:17  Infix operators must be spaced.                                                 space-infix-ops
  ✖   63:20  Expected === and instead saw ==.                                                eqeqeq
  ✖   63:23  Identifier stop_times_length is not in camel case.                              camelcase
  ✖   65:15  arrivalStop used outside of binding context.                                    block-scoped-var
  ✖   68:9   Closing curly brace does not appear on the same line as the subsequent block.   brace-style
  ✖   69:15  arrivalStop used outside of binding context.                                    block-scoped-var
  ✖   69:15  arrivalStop is already defined                                                  no-redeclare
  ✖   69:29  Multiple spaces found before =.                                                 no-multi-spaces
  ✖   69:72  Infix operators must be spaced.                                                 space-infix-ops
  ✖   71:9   Split var declarations into multiple statements.                                one-var
  ✖   72:13  Expected indentation of 10 space characters but found 12.                       indent
  ✖   73:9   Expected exception block, space or tab after // in comment.                     spaced-comment
  ✖   74:13  Identifier stop_time is not in camel case.                                      camelcase
  ✖   74:34  Identifier stop_time is not in camel case.                                      camelcase
  ✖   74:60  Identifier stop_time is not in camel case.                                      camelcase
  ✖   75:34  Identifier stop_time is not in camel case.                                      camelcase
  ✖   77:14  Identifier stop_time is not in camel case.                                      camelcase
  ✖   77:38  Identifier stop_time is not in camel case.                                      camelcase
  ✖   77:67  Identifier stop_time is not in camel case.                                      camelcase
  ✖   78:11  Unexpected negated condition.                                                   no-negated-condition
  ✖   79:13  Expected exception block, space or tab after // in comment.                     spaced-comment
  ✖   84:36  Identifier stop_time is not in camel case.                                      camelcase
  ✖   90:1   Trailing spaces not allowed.                                                    no-trailing-spaces
  ✖   90:2   More than 1 blank line not allowed.                                             no-multiple-empty-lines
  ✖   91:34  Multiple spaces found before =.                                                 no-multi-spaces
  ✖   91:36  Identifier stop_time is not in camel case.                                      camelcase
  ✖   91:53  Infix operators must be spaced.                                                 space-infix-ops
  ✖   91:55  Identifier stop_time is not in camel case.                                      camelcase
  ✖   92:36  Multiple spaces found before =.                                                 no-multi-spaces
  ✖   92:38  Identifier stop_time is not in camel case.                                      camelcase
  ✖   92:57  Infix operators must be spaced.                                                 space-infix-ops
  ✖   92:59  Identifier stop_time is not in camel case.                                      camelcase
  ✖   93:53  Trailing spaces not allowed.                                                    no-trailing-spaces
  ✖   94:24  + should be placed at the end of the line.                                      operator-linebreak
  ✖   95:24  Bad line breaking before and after +.                                           operator-linebreak
  ✖   95:24  Trailing spaces not allowed.                                                    no-trailing-spaces
  ✖   97:24  Bad line breaking before and after +.                                           operator-linebreak
  ✖   98:78  A space is required after ,.                                                    comma-spacing
  ✖   99:24  + should be placed at the end of the line.                                      operator-linebreak
  ✖  100:24  + should be placed at the end of the line.                                      operator-linebreak
  ✖  100:56  Trailing spaces not allowed.                                                    no-trailing-spaces
  ✖  103:11  Extra space after key @id.                                                      key-spacing
  ✖  103:11  Strings must use singlequote.                                                   quotes
  ✖  104:11  Extra space after key @type.                                                    key-spacing
  ✖  104:11  Strings must use singlequote.                                                   quotes
  ✖  105:11  Strings must use singlequote.                                                   quotes
  ✖  105:11  Extra space after key departureStop.                                            key-spacing
  ✖  105:31  Strings must use singlequote.                                                   quotes
  ✖  106:11  Strings must use singlequote.                                                   quotes
  ✖  106:11  Extra space after key arrivalStop.                                              key-spacing
  ✖  106:31  Strings must use singlequote.                                                   quotes
  ✖  106:68  arrivalStop used outside of binding context.                                    block-scoped-var
  ✖  106:68  arrivalStop used outside of binding context.                                    block-scoped-var
  ✖  107:11  Strings must use singlequote.                                                   quotes
  ✖  107:11  Extra space after key arrivalTime.                                              key-spacing
  ✖  108:11  Extra space after key departureTime.                                            key-spacing
  ✖  108:11  Strings must use singlequote.                                                   quotes
  ✖  109:11  Extra space after key arrivalDelay.                                             key-spacing
  ✖  109:11  Strings must use singlequote.                                                   quotes
  ✖  110:11  Strings must use singlequote.                                                   quotes
  ✖  110:11  Extra space after key departureDelay.                                           key-spacing
  ✖  111:11  Strings must use singlequote.                                                   quotes
  ✖  111:11  Extra space after key gtfs:trip.                                                key-spacing
  ✖  111:31  Strings must use singlequote.                                                   quotes
  ✖  111:58  Identifier trip_id is not in camel case.                                        camelcase
  ✖  112:11  Extra space after key gtfs:route.                                               key-spacing
  ✖  112:11  Strings must use singlequote.                                                   quotes
  ✖  112:31  Strings must use singlequote.                                                   quotes
  ✖  112:65  Identifier gtfs_route is not in camel case.                                     camelcase
  ✖  113:10  Missing semicolon.                                                              semi
  ✖  120:7   Expected exception block, space or tab after // in comment.                     spaced-comment
  ✖  126:2   More than 1 blank line not allowed.                                             no-multiple-empty-lines
  ✖  133:1   Opening curly brace does not appear on the same line as controlling statement.  brace-style
  ✖  135:3   Opening curly brace does not appear on the same line as controlling statement.  brace-style
  ✖  135:3   Opening curly brace does not appear on the same line as controlling statement.  brace-style
  ✖  140:3   Closing curly brace does not appear on the same line as the subsequent block.   brace-style
  ✖  140:3   Unexpected else after return.                                                   no-else-return
  ✖  145:2   More than 1 blank line not allowed.                                             no-multiple-empty-lines
  ✖  146:1   Expected exception block, space or tab after // in comment.                     spaced-comment
  ✖  148:49  Missing semicolon.                                                              semi
  ✖  150:28  Expected === and instead saw ==.                                                eqeqeq
  ✖  152:35  Expected === and instead saw ==.                                                eqeqeq
  ✖  153:52  Missing semicolon.                                                              semi
  ✖  155:7   responseBody is defined but never used                                          no-unused-vars
  ✖  158:5   Unexpected negated condition.                                                   no-negated-condition
  ✖  161:60  Infix operators must be spaced.                                                 space-infix-ops
  ✖  169:5   Missing semicolon.                                                              semi

  124 errors

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants