Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Trim trailing whitespace and add EOF

  • Loading branch information...
commit 2cb9e80cc4638076a4be9af40b9c04d726f9c810 1 parent e73ff7b
Sindre Sorhus sindresorhus authored
Showing with 100 additions and 100 deletions.
  1. +1 −1  .editorconfig
  2. +1 −1  cli/bin/help.txt
  3. +1 −1  cli/lib/generators/angular/readme.md
  4. +2 −2 cli/lib/generators/angular/templates/app.js
  5. +1 −1  cli/lib/generators/angular/templates/controller.js
  6. +1 −1  cli/lib/generators/angular/templates/directives.js
  7. +1 −1  cli/lib/generators/angular/templates/filters.js
  8. +1 −1  cli/lib/generators/angular/templates/partials1.html
  9. +1 −1  cli/lib/generators/angular/templates/partials2.html
  10. +1 −1  cli/lib/generators/angular/templates/services.js
  11. +6 −6 cli/lib/generators/backbone/all/index.js
  12. +1 −1  cli/lib/generators/backbone/collection/index.js
  13. +1 −1  cli/lib/generators/backbone/readme.md
  14. +1 −1  cli/lib/generators/backbone/templates/app.js
  15. +1 −1  cli/lib/generators/backbone/templates/collection.js
  16. +1 −1  cli/lib/generators/backbone/templates/model.js
  17. +2 −2 cli/lib/generators/backbone/templates/router.js
  18. +1 −1  cli/lib/generators/backbone/templates/view.js
  19. +1 −1  cli/lib/generators/ember/templates/application.handlebars
  20. +1 −1  cli/lib/generators/wiring.js
  21. +7 −7 cli/lib/generators/yeoman/app/index.js
  22. +1 −1  cli/lib/generators/yeoman/app/templates/Gruntfile.js
  23. +2 −2 cli/lib/generators/yeoman/simpleapp/templates/Gruntfile.js
  24. +1 −1  cli/samples/todos_spine_requirejs/.htaccess
  25. +1 −1  cli/samples/todos_spine_requirejs/Gruntfile.js
  26. +7 −7 cli/samples/todos_spine_requirejs/js/coffee/Task.coffee
  27. +8 −8 cli/samples/todos_spine_requirejs/js/coffee/Tasks.coffee
  28. +3 −3 cli/samples/todos_spine_requirejs/js/coffee/spineModule.js
  29. +1 −1  cli/samples/todos_spine_requirejs/js/hm/nyan.hm
  30. +1 −1  cli/samples/todos_spine_requirejs/package.json
  31. +2 −2 cli/tasks/coffee.js
  32. +1 −1  cli/tasks/compass.js
  33. +1 −1  cli/tasks/less.js
  34. +1 −1  cli/tasks/livereload/livereload.js
  35. +1 −1  cli/tasks/misc.js
  36. +14 −14 cli/tasks/usemin.js
  37. +1 −1  metrics/app.yaml
  38. +2 −2 metrics/settings.py
  39. +13 −13 metrics/shardedcounter.py
  40. +1 −1  metrics/static/js/app.js
  41. +1 −1  metrics/static/scss/_base.scss
  42. +1 −1  metrics/static/scss/app.scss
  43. +2 −2 metrics/yeomaninsight.py
2  .editorconfig
View
@@ -7,4 +7,4 @@ indent_size = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
-insert_final_newline = true
+insert_final_newline = true
2  cli/bin/help.txt
View
@@ -12,4 +12,4 @@
<%= 'update'.yellow %> <%= 'Update a package to the latest version'.grey %>
<%= 'list'.yellow %> <%= 'List the packages currently installed'.grey %>
<%= 'search'.yellow %> <%= 'Query the registry for matching package names'.grey %>
- <%= 'lookup'.yellow %> <%= 'Look up info on a particular package'.grey %>
+ <%= 'lookup'.yellow %> <%= 'Look up info on a particular package'.grey %>
2  cli/lib/generators/angular/readme.md
View
@@ -4,4 +4,4 @@ Currently as this doesn't follow the same model/view/controller structure
as we expect, it should be used via yeoman g angular:bootstrap until we've
figured out how better to hook everything up.
-Based on https://github.com/angular/angular-seed/
+Based on https://github.com/angular/angular-seed/
4 cli/lib/generators/angular/templates/app.js
View
@@ -5,7 +5,7 @@
//= require_tree ./templates
//= require_self
-// The angular application is created elsewhere (application.js)
+// The angular application is created elsewhere (application.js)
// where this file is required through the pipeline
'use strict';
@@ -16,4 +16,4 @@ angular.module(<%= grunt.util._.camelize(appname) %>, ['<%= grunt.util._.cameliz
$routeProvider.when('/view1', {templateUrl: 'partials/partial1.html', controller: MyCtrl1});
$routeProvider.when('/view2', {templateUrl: 'partials/partial2.html', controller: MyCtrl2});
$routeProvider.otherwise({redirectTo: '/view1'});
- }]);
+ }]);
2  cli/lib/generators/angular/templates/controller.js
View
@@ -10,4 +10,4 @@ MyCtrl1.$inject = [];
function MyCtrl2() {
}
-MyCtrl2.$inject = [];
+MyCtrl2.$inject = [];
2  cli/lib/generators/angular/templates/directives.js
View
@@ -7,4 +7,4 @@ angular.module('<%= _.camelize(appname) %>.directives', []).
return function(scope, elm, attrs) {
elm.text(version);
};
- }]);
+ }]);
2  cli/lib/generators/angular/templates/filters.js
View
@@ -7,4 +7,4 @@ angular.module('<%= _.camelize(appname) %>.filters', []).
return function(text) {
return String(text).replace(/\%VERSION\%/mg, version);
}
- }]);
+ }]);
2  cli/lib/generators/angular/templates/partials1.html
View
@@ -1 +1 @@
-<p>This is the partial for view 1.</p>
+<p>This is the partial for view 1.</p>
2  cli/lib/generators/angular/templates/partials2.html
View
@@ -2,4 +2,4 @@
<p>
Showing of 'interpolate' filter:
{{ 'Current version is v%VERSION%.' | interpolate }}
-</p>
+</p>
2  cli/lib/generators/angular/templates/services.js
View
@@ -6,4 +6,4 @@
// Demonstrate how to register services
// In this case it is a simple value service.
angular.module('<%= _.camelize(appname) %>.services', []).
- value('version', '0.1');
+ value('version', '0.1');
12 cli/lib/generators/backbone/all/index.js
View
@@ -39,16 +39,16 @@ Generator.prototype.injectBackbone = function injectBackbone() {
// Read in as string for further update
var indexData = this.readFileAsString(indexOut);
-
+
// Workaround until copying underscore/lodash-like scripts don't cause issues.
- indexData = this.appendScripts(indexData,
- 'app/js/vendor.js',
- ['http://cdnjs.cloudflare.com/ajax/libs/lodash.js/0.4.1/lodash.min.js',
+ indexData = this.appendScripts(indexData,
+ 'app/js/vendor.js',
+ ['http://cdnjs.cloudflare.com/ajax/libs/lodash.js/0.4.1/lodash.min.js',
'http://cdnjs.cloudflare.com/ajax/libs/backbone.js/0.9.2/backbone-min.js']);
// Wire MVC components (usemin: app/js/myapp.js)
- indexData = this.appendScripts(indexData,
- 'app/js/myapp.js',
+ indexData = this.appendScripts(indexData,
+ 'app/js/myapp.js',
['app/js/' + this.appname +'.js',
'app/js/views/application-view.js',
'app/js/models/application-model.js',
2  cli/lib/generators/backbone/collection/index.js
View
@@ -8,7 +8,7 @@ module.exports = Generator;
function Generator() {
yeoman.generators.NamedBase.apply(this, arguments);
this.sourceRoot(path.join(__dirname, '../templates'));
-
+
this.appname = path.basename(process.cwd());
}
2  cli/lib/generators/backbone/readme.md
View
@@ -30,4 +30,4 @@ Writing app/js/models/application-model.js...OK
Writing app/js/collections/application-collection.js...OK
.. Invoke backbone:router:bootstrap ..
-Writing app/js/routes/app-router.js...OK
+Writing app/js/routes/app-router.js...OK
2  cli/lib/generators/backbone/templates/app.js
View
@@ -11,4 +11,4 @@ window.<%= grunt.util._.camelize(appname) %> = {
$(document).ready(function(){
<%= grunt.util._.camelize(appname) %>.init();
-});
+});
2  cli/lib/generators/backbone/templates/collection.js
View
@@ -2,4 +2,4 @@
model: <%= _.camelize(appname) %>.<%= _.classify(name) %>Model
-});
+});
2  cli/lib/generators/backbone/templates/model.js
View
@@ -1,3 +1,3 @@
<%= _.camelize(appname) %>.<%= _.classify(name) %>Model = Backbone.Model.extend({
-});
+});
4 cli/lib/generators/backbone/templates/router.js
View
@@ -1,3 +1,3 @@
<%= grunt.util._.camelize(appname) %>.Router = Backbone.Router.extend({
-
-});
+
+});
2  cli/lib/generators/backbone/templates/view.js
View
@@ -2,4 +2,4 @@
//template: <%= grunt.util._.underscored(name) %>
-});
+});
2  cli/lib/generators/ember/templates/application.handlebars
View
@@ -1,3 +1,3 @@
<h1><%= application_name %></h1>
-{{outlet}}
+{{outlet}}
2  cli/lib/generators/wiring.js
View
@@ -115,7 +115,7 @@ Wiring.appendScripts = function appendScripts(html, optimizedPath, sourceFileLis
return Wiring.appendFiles(html, 'js', optimizedPath, sourceFileList);
}
-// Simple script removal.
+// Simple script removal.
// Todo: establish if Cheerio has workarounds for script selectors
Wiring.removeScript = function removeScript(html, scriptPath){
14 cli/lib/generators/yeoman/app/index.js
View
@@ -60,7 +60,7 @@ AppGenerator.prototype.gitignore = function gitignore() {
AppGenerator.prototype.fetchH5bp = function fetchH5bp() {
var cb = this.async();
var self = this;
-
+
// Fecth allows the download of single files, into the destination directory
this.fetch('https://raw.github.com/h5bp/html5-boilerplate/master/index.html', 'index.html', function(err) {
if(err) return cb(err);
@@ -82,20 +82,20 @@ AppGenerator.prototype.fetchH5bp = function fetchH5bp() {
// Wire Twitter Bootstrap plugins (usemin: app/js/plugins.js)
indexData = self.appendScripts(indexData,
'app/js/plugins.js',
- ["app/js/vendor/bootstrap/bootstrap-alert.js",
- "app/js/vendor/bootstrap/bootstrap-dropdown.js",
+ ["app/js/vendor/bootstrap/bootstrap-alert.js",
+ "app/js/vendor/bootstrap/bootstrap-dropdown.js",
"app/js/vendor/bootstrap/bootstrap-tooltip.js",
"app/js/vendor/bootstrap/bootstrap-modal.js",
"app/js/vendor/bootstrap/bootstrap-transition.js",
"app/js/vendor/bootstrap/bootstrap-button.js",
- "app/js/vendor/bootstrap/bootstrap-popover.js",
+ "app/js/vendor/bootstrap/bootstrap-popover.js",
"app/js/vendor/bootstrap/bootstrap-typeahead.js",
- "app/js/vendor/bootstrap/bootstrap-carousel.js",
+ "app/js/vendor/bootstrap/bootstrap-carousel.js",
"app/js/vendor/bootstrap/bootstrap-scrollspy.js",
- "app/js/vendor/bootstrap/bootstrap-collapse.js",
+ "app/js/vendor/bootstrap/bootstrap-collapse.js",
"app/js/vendor/bootstrap/bootstrap-tab.js"]);
// Alternative: indexData = _this.appendScriptsDir(indexData, 'js/plugins.js', path.resolve('app/js/vendor/bootstrap'));
-
+
// Write out final file
self.writeFileFromString(indexData, indexOut);
2  cli/lib/generators/yeoman/app/templates/Gruntfile.js
View
@@ -123,7 +123,7 @@ module.exports = function(grunt) {
// usemin handler should point to the file containing
// the usemin blocks to be parsed
- 'usemin-handler': {
+ 'usemin-handler': {
html: 'index.html'
},
4 cli/lib/generators/yeoman/simpleapp/templates/Gruntfile.js
View
@@ -117,10 +117,10 @@ module.exports = function(grunt) {
// usemin handler should point to the file containing
// the usemin blocks to be parsed
- 'usemin-handler': {
+ 'usemin-handler': {
html: 'index.html'
},
-
+
// update references in html / css to revved files
usemin: {
html: ['**/*.html'],
2  cli/samples/todos_spine_requirejs/.htaccess
View
@@ -101,7 +101,7 @@ AddType audio/mp4 m4a f4a f4b
# Video
AddType video/ogg ogv
-AddType video/mp4 mp4 m4v f4v f4p
+AddType video/mp4 mp4 m4v f4v f4p
AddType video/webm webm
AddType video/x-flv flv
2  cli/samples/todos_spine_requirejs/Gruntfile.js
View
@@ -179,7 +179,7 @@ module.exports = function(grunt) {
});
-
+
// Alias the `test` task to run the `jasmine` task instead
grunt.registerTask('test', 'jasmine');
14 cli/samples/todos_spine_requirejs/js/coffee/Task.coffee
View
@@ -1,19 +1,19 @@
define (require, exports, module) ->
module.exports = Task
-
-
+
+
Spine = require "coffee/spineModule"
-
+
class Task extends Spine.Model
@configure "Task", "name", "done"
-
+
@extend Spine.Model.Local
-
+
@active: ->
@select (item) -> !item.done
-
+
@done: ->
@select (item) -> !!item.done
-
+
@destroyDone: ->
rec.destroy() for rec in @done()
16 cli/samples/todos_spine_requirejs/js/coffee/Tasks.coffee
View
@@ -13,33 +13,33 @@ define (require, exports, module) ->
"dblclick .view": "edit"
"keypress input[type=text]": "blurOnEnter"
"blur input[type=text]": "close"
-
+
elements:
"input[type=text]": "input"
-
+
constructor: ->
super
@item.bind("update", @render)
@item.bind("destroy", @release)
-
+
render: =>
@replace(jQuery("#taskTemplate").tmpl(@item))
@
-
+
toggle: ->
@item.done = !@item.done
@item.save()
-
+
remove: ->
@item.destroy()
-
+
edit: ->
@el.addClass("editing")
@input.focus()
-
+
blurOnEnter: (e) ->
if e.keyCode is 13 then e.target.blur()
-
+
close: ->
@el.removeClass("editing")
@item.updateAttributes({name: @input.val()})
6 cli/samples/todos_spine_requirejs/js/coffee/spineModule.js
View
@@ -1,6 +1,6 @@
define(
["spine", "local", "manager"], function(spine,local,manager) {
-
+
// when the spine scripts above execute, they stick a Spine onto the global namespace which
// we don't want to use... so using a closure here to extract a private reference to that and
// once we've got it we can delete the window.Spine reference and then force all of our code
@@ -16,5 +16,5 @@ define(
return _innerSpine;
};
- return findSpine;
-}());
+ return findSpine;
+}());
2  cli/samples/todos_spine_requirejs/js/hm/nyan.hm
View
@@ -4,4 +4,4 @@ export function animator(items){
if(items instanceof jQuery){
items.find('.special').html('<img src="img/nyan.gif"/>');
}
-}
+}
2  cli/samples/todos_spine_requirejs/package.json
View
@@ -18,4 +18,4 @@
],
"dependencies": {},
"keywords": []
-}
+}
4 cli/tasks/coffee.js
View
@@ -16,7 +16,7 @@ module.exports = function(grunt) {
grunt.registerHelper('coffee', function(src, destPath) {
var coffee = require('coffee-script'),
js = '',
- dest = path.join(destPath,
+ dest = path.join(destPath,
path.basename(src, '.coffee') + '.js');
try {
@@ -27,4 +27,4 @@ module.exports = function(grunt) {
}
});
-};
+};
2  cli/tasks/compass.js
View
@@ -40,4 +40,4 @@ module.exports = function( grunt ) {
compass.stdout.pipe( process.stdout );
compass.stderr.pipe( process.stderr );
});
-};
+};
2  cli/tasks/less.js
View
@@ -74,4 +74,4 @@ grunt.registerHelper('less', function(o) {
};
});
-};
+};
2  cli/tasks/livereload/livereload.js
View
@@ -1053,4 +1053,4 @@ LiveReload.on('disconnect', function() {
CustomEvents.bind(document, 'LiveReloadShutDown', function() {
return LiveReload.shutDown();
});
-})();
+})();
2  cli/tasks/misc.js
View
@@ -122,7 +122,7 @@ module.exports = function(grunt) {
grunt.registerHelper('copy', function(src, dest, ignores, cb) {
if(!cb) { cb = ignores; ignores = ['.gitignore', '.ignore', '.buildignore']; }
- function error(msg) {
+ function error(msg) {
return function(e) {
if(!e) {
grunt.log.writeln();
28 cli/tasks/usemin.js
View
@@ -8,10 +8,10 @@ var fs = require('fs'),
// Replaces references to non-optimized scripts or stylesheets
// into a set of HTML files (or any templates/views).
//
-// The users markup should be considered the primary source of information
-// for paths, references to assets which should be optimized.We also check
-// against files present in the relevant directory () (e.g checking against
-// the revved filename into the 'intermediate/') directory to find the SHA
+// The users markup should be considered the primary source of information
+// for paths, references to assets which should be optimized.We also check
+// against files present in the relevant directory () (e.g checking against
+// the revved filename into the 'intermediate/') directory to find the SHA
// that was generated.
//
// Todos:
@@ -22,12 +22,12 @@ var fs = require('fs'),
// Thx to @krzychukula for the new, super handy replace helper.
//
// #### Usemin-handler
-//
-// A special task which uses the build block HTML comments in markup to
-// get back the list of files to handle, and initialize the grunt configuration
+//
+// A special task which uses the build block HTML comments in markup to
+// get back the list of files to handle, and initialize the grunt configuration
// appropriately, and automatically.
//
-// Custom HTML "block" comments are provided as an API for interacting with the
+// Custom HTML "block" comments are provided as an API for interacting with the
// build script. These comments adhere to the following pattern:
//
// <!-- build:<type> <path> -->
@@ -35,7 +35,7 @@ var fs = require('fs'),
// <!-- endbuild -->
//
// - type: is either js or css.
-// - path: is the file path of the optimized file, the target output.
+// - path: is the file path of the optimized file, the target output.
//
// An example of this in completed form can be seen below:
//
@@ -46,7 +46,7 @@ var fs = require('fs'),
// <script src="js/views/thing-view.js"></script>
// <!-- endbuild -->
//
-//
+//
// Internally, the task parses your HTML markup to find each of these blocks, and
// initializes for you the corresponding Grunt config for the concat / min tasks
// when `type=js`, the concat / css tasks when `type=css`.
@@ -130,10 +130,10 @@ module.exports = function(grunt) {
// parse out the list of assets to handle, and update the grunt config accordingly
var assets = lines.map(function(tag) {
-
+
// RequireJS uses a data-main attribute on the script tag to tell RequireJS
// to load up the scripts/mainEntryPoint.js file. The below regex should be
- // able to handle both cases of data-main="scripts/main" as well as
+ // able to handle both cases of data-main="scripts/main" as well as
// data-main="scripts/main.js"
var main = tag.match(/data-main=['"]([^'"]+)['"]/);
@@ -349,13 +349,13 @@ function getBlocks(body) {
// dest: 'css/site.css',
// src: [
// 'css/normalize.css',
-// 'css/main.css'
+// 'css/main.css'
// ],
// raw: [
// ' <!-- build:css css/site.css -->',
// ' <link rel="stylesheet" href="css/normalize.css">',
// ' <link rel="stylesheet" href="css/main.css">',
-// ' <!-- endbuild -->'
+// ' <!-- endbuild -->'
// ]
// }
2  metrics/app.yaml
View
@@ -45,4 +45,4 @@ skip_files:
- ^(.*/)?.*/RCS/.*
- ^(.*/)?\..*
- ^(.*/)?.*\.scss$
-- ^(.*/)?.*\.psd$
+- ^(.*/)?.*\.psd$
4 metrics/settings.py
View
@@ -2,7 +2,7 @@
import os
# Get version of Yeoman out of package file, otherwise use GAE app.yaml version
-# for this app.
+# for this app.
def get_app_data():
version_str = []
try:
@@ -10,7 +10,7 @@ def get_app_data():
os.path.dirname(__file__), '..', 'cli', 'package.json'))
data = json.load(f)
f.close()
- return {'cli_name': data['name'], 'version': data['version']}
+ return {'cli_name': data['name'], 'version': data['version']}
except:
return os.environ['CURRENT_VERSION_ID'].split('.')[0]
26 metrics/shardedcounter.py
View
@@ -13,7 +13,7 @@
# limitations under the License.
#
-from google.appengine.api import memcache
+from google.appengine.api import memcache
from google.appengine.ext import db
import random
@@ -27,13 +27,13 @@ class GeneralCounterShard(db.Model):
"""Shards for each named counter"""
name = db.StringProperty(required=True)
count = db.IntegerProperty(required=True, default=0)
-
-
+
+
def get_count(name):
"""Retrieve the value for a given sharded counter.
-
+
Parameters:
- name - The name of the counter
+ name - The name of the counter
"""
total = memcache.get(name)
if total is None:
@@ -43,12 +43,12 @@ def get_count(name):
memcache.add(name, total, 60)
return total
-
+
def increment(name):
"""Increment the value for a given sharded counter.
-
+
Parameters:
- name - The name of the counter
+ name - The name of the counter
"""
config = GeneralCounterShardConfig.get_or_insert(name, name=name)
def txn():
@@ -63,19 +63,19 @@ def txn():
# does nothing if the key does not exist
memcache.incr(name)
-
-def increase_shards(name, num):
+
+def increase_shards(name, num):
"""Increase the number of shards for a given sharded counter.
Will never decrease the number of shards.
-
+
Parameters:
name - The name of the counter
num - How many shards to use
-
+
"""
config = GeneralCounterShardConfig.get_or_insert(name, name=name)
def txn():
if config.num_shards < num:
config.num_shards = num
- config.put()
+ config.put()
db.run_in_transaction(txn)
2  metrics/static/js/app.js
View
@@ -36,4 +36,4 @@ document.querySelector('#test_buttons').addEventListener('click', function(e) {
var resp = JSON.parse(xhr.response);
console.log(resp);
}, data);
-});
+});
2  metrics/static/scss/_base.scss
View
@@ -34,4 +34,4 @@ a {
a:hover {
color: navy;
text-decoration: underline;
-}
+}
2  metrics/static/scss/app.scss
View
@@ -41,4 +41,4 @@ footer {
@include box-orient(vertical);
@include box-flex(2);
//height: 100%;
-}
+}
4 metrics/yeomaninsight.py
View
@@ -51,7 +51,7 @@ def __init__(self, tracking_code):
self.__reset_file(f, self.client_id)
self.record('downloaded')
- self._send_all()
+ self._send_all()
else:
f.seek(0)
@@ -148,7 +148,7 @@ def _send_all(self):
# Proceed with resetting file if everything went well.
if sent:
# Reset the file by clearing it and adding in the client id.
- f = open(LOG_FILE, 'w+')
+ f = open(LOG_FILE, 'w+')
self.__reset_file(f, self.client_id)
f.close()
Please sign in to comment.
Something went wrong with that request. Please try again.