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

Fixes #860. Enable pep8 for Travis (and make eslint task do what we want for JS) #861

Merged
merged 8 commits into from
Dec 15, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,14 @@
markdownitEmoji: true,
markdownitSanitizer: true,
md: true,
module: true,
moment: true,
Mousetrap: true,
PaginationMixin: true,
Prism: true,
qr: true,
repoPath: true,
require: true,
wcEvents: true
},
"rules": {
Expand Down
3 changes: 3 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,13 @@ install:
- travis_retry npm install
- travis_retry pip install -r requirements.txt --download-cache $HOME/.pip-cache
- cp config.py.example config.py
# lint python
- pep8 --ignore=E402 webcompat/ tests/ config.py.example
- python run.py -t &

before_script:
- "sleep 2"
# lint JS in default eslint task
- grunt

# now run the tests!
Expand Down
4 changes: 2 additions & 2 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */

module.exports = function (grunt) {
module.exports = function(grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
jsPath: 'webcompat/static/js',
Expand All @@ -19,7 +19,7 @@ module.exports = function (grunt) {
grunt.loadTasks('grunt-tasks');

// load all grunt tasks
require('load-grunt-tasks')(grunt)
require('load-grunt-tasks')(grunt);

// Default task.
grunt.registerTask('default', [
Expand Down
8 changes: 4 additions & 4 deletions config.py.example
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,8 @@ if not PRODUCTION:
LOG_FILE = '/tmp/webcompat.log'
LOG_FMT = '%(asctime)s %(levelname)s: %(message)s [in %(pathname)s:%(lineno)d]'

# Get the client id and client secret from GitHub if you're part of the webcompat
# organization. Otherwise, create your own test and production applications,
# Get the client id and client secret from GitHub if you're part of the
# webcompat org. Otherwise, create your own test and production applications,
# and take note of the client id and client secret GitHub gives you.
#
# [1]<https://github.com/organizations/webcompat/settings/applications/>
Expand All @@ -84,7 +84,7 @@ elif DEVELOPMENT:
else:
# We're running on localhost, use the test application
GITHUB_CLIENT_ID = os.environ.get('FAKE_ID') or ""
GITHUB_CLIENT_SECRET = os.environ.get('FAKE_SECRET') or ""
GITHUB_CLIENT_SECRET = os.environ.get('FAKE_SECRET') or ""
GITHUB_CALLBACK_URL = "http://localhost:5000/callback"

# GiHub Issues repo URI
Expand All @@ -93,7 +93,7 @@ if PRODUCTION:
else:
# Development and Local instances use the same test repo
# Expects a string like "<user>/<repo>/issues", e.g.,
# ISSUES_REPO_URI = os.environ.get('ISSUES_REPO_URI') or "miketaylr/test-repo/issues"
# ISSUES_REPO_URI = os.environ.get('ISSUES_REPO_URI') or "foo/bar/issues"
ISSUES_REPO_URI = os.environ.get('ISSUES_REPO_URI') or ""

# This is the oauth token we use to report issues on behalf of people
Expand Down
16 changes: 8 additions & 8 deletions grunt-tasks/cmq.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@

module.exports = function(grunt) {
grunt.config('cmq', {
options: {
log: true
},
your_target: {
files: {
'<%= cssPath %>' : ['<%= cssPath %>/webcompat.dev.css']
}
options: {
log: true
},
your_target: {
files: {
'<%= cssPath %>' : ['<%= cssPath %>/webcompat.dev.css']
}
});
}
});
};
144 changes: 72 additions & 72 deletions grunt-tasks/concat.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,76 +4,76 @@

module.exports = function(grunt) {
grunt.config('concat', {
options: {
banner: '<%= banner %>',
stripBanners: false
},
dist: {
src: [
'<%= jsPath %>/vendor/jquery-1.11.2.min.js',
'<%= jsPath %>/vendor/lodash.custom.min.js',
'<%= jsPath %>/vendor/backbone-min.js',
'<%= jsPath %>/vendor/moment-min.js',
'<%= jsPath %>/vendor/prism.js',
'<%= jsPath %>/vendor/markdown-it.js',
'<%= jsPath %>/vendor/markdown-it-emoji-1.0.0.js',
'<%= jsPath %>/vendor/markdown-it-sanitizer-0.4.1.js',
'<%= jsPath %>/vendor/mousetrap-min.js',
'<%= jsPath %>/vendor/backbone.mousetrap.js',
'<%= jsPath %>/lib/flash-message.js',
'<%= jsPath %>/lib/homepage.js',
'<%= jsPath %>/lib/bugform.js'
],
dest: '<%= jsPath %>/<%= pkg.name %>.js'
},
diagnose: {
src: [
'<%= jsPath %>/lib/models/label-list.js',
'<%= jsPath %>/lib/labels.js',
'<%= jsPath %>/lib/models/issue.js',
'<%= jsPath %>/lib/diagnose.js'
],
dest: '<%= jsPath %>/diagnose.js'
},
issues: {
src: [
'<%= jsPath %>/vendor/qr.min.js',
'<%= jsPath %>/lib/models/label-list.js',
'<%= jsPath %>/lib/labels.js',
'<%= jsPath %>/lib/models/issue.js',
'<%= jsPath %>/lib/models/comment.js',
'<%= jsPath %>/lib/comments.js',
'<%= jsPath %>/lib/qrcode.js',
'<%= jsPath %>/lib/issues.js',
],
dest: '<%= jsPath %>/issues.js'
},
issueList: {
src: [
'<%= jsPath %>/lib/models/label-list.js',
'<%= jsPath %>/lib/labels.js',
'<%= jsPath %>/lib/models/issue.js',
'<%= jsPath %>/lib/mixins/pagination.js',
'<%= jsPath %>/lib/issue-list.js'
],
dest: '<%= jsPath %>/issue-list.js'
},
userActivity: {
src: [
'<%= jsPath %>/lib/models/label-list.js',
'<%= jsPath %>/lib/models/issue.js',
'<%= jsPath %>/lib/mixins/pagination.js',
'<%= jsPath %>/lib/user-activity.js'
],
dest: '<%= jsPath %>/user-activity.js'
},
cssFixmeLibs: {
src: [
'git_modules/css-fixme/js/css-browserside.js',
'git_modules/css-fixme/js/css-fixme.js',
'<%= jsPath %>/lib/css-fixme-ui.js'
],
dest: '<%= jsPath %>/cssfixme/cssfixme.js'
}
});
options: {
banner: '<%= banner %>',
stripBanners: false
},
dist: {
src: [
'<%= jsPath %>/vendor/jquery-1.11.2.min.js',
'<%= jsPath %>/vendor/lodash.custom.min.js',
'<%= jsPath %>/vendor/backbone-min.js',
'<%= jsPath %>/vendor/moment-min.js',
'<%= jsPath %>/vendor/prism.js',
'<%= jsPath %>/vendor/markdown-it.js',
'<%= jsPath %>/vendor/markdown-it-emoji-1.0.0.js',
'<%= jsPath %>/vendor/markdown-it-sanitizer-0.4.1.js',
'<%= jsPath %>/vendor/mousetrap-min.js',
'<%= jsPath %>/vendor/backbone.mousetrap.js',
'<%= jsPath %>/lib/flash-message.js',
'<%= jsPath %>/lib/homepage.js',
'<%= jsPath %>/lib/bugform.js'
],
dest: '<%= jsPath %>/<%= pkg.name %>.js'
},
diagnose: {
src: [
'<%= jsPath %>/lib/models/label-list.js',
'<%= jsPath %>/lib/labels.js',
'<%= jsPath %>/lib/models/issue.js',
'<%= jsPath %>/lib/diagnose.js'
],
dest: '<%= jsPath %>/diagnose.js'
},
issues: {
src: [
'<%= jsPath %>/vendor/qr.min.js',
'<%= jsPath %>/lib/models/label-list.js',
'<%= jsPath %>/lib/labels.js',
'<%= jsPath %>/lib/models/issue.js',
'<%= jsPath %>/lib/models/comment.js',
'<%= jsPath %>/lib/comments.js',
'<%= jsPath %>/lib/qrcode.js',
'<%= jsPath %>/lib/issues.js',
],
dest: '<%= jsPath %>/issues.js'
},
issueList: {
src: [
'<%= jsPath %>/lib/models/label-list.js',
'<%= jsPath %>/lib/labels.js',
'<%= jsPath %>/lib/models/issue.js',
'<%= jsPath %>/lib/mixins/pagination.js',
'<%= jsPath %>/lib/issue-list.js'
],
dest: '<%= jsPath %>/issue-list.js'
},
userActivity: {
src: [
'<%= jsPath %>/lib/models/label-list.js',
'<%= jsPath %>/lib/models/issue.js',
'<%= jsPath %>/lib/mixins/pagination.js',
'<%= jsPath %>/lib/user-activity.js'
],
dest: '<%= jsPath %>/user-activity.js'
},
cssFixmeLibs: {
src: [
'git_modules/css-fixme/js/css-browserside.js',
'git_modules/css-fixme/js/css-fixme.js',
'<%= jsPath %>/lib/css-fixme-ui.js'
],
dest: '<%= jsPath %>/cssfixme/cssfixme.js'
}
});
};
24 changes: 12 additions & 12 deletions grunt-tasks/cssmin.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,17 @@

module.exports = function(grunt) {
grunt.config('cssmin', {
options: {
banner: '<%= banner %>'
},
combine: {
files: {
// output
'<%= cssPath %>/webcompat.min.css': [
// input
'<%= cssPath %>/webcompat.dev.css'
]
}
options: {
banner: '<%= banner %>'
},
combine: {
files: {
// output
'<%= cssPath %>/webcompat.min.css': [
// input
'<%= cssPath %>/webcompat.dev.css'
]
}
});
}
});
};
12 changes: 6 additions & 6 deletions grunt-tasks/cssnext.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ module.exports = function(grunt) {
sourcemap: true,
url : false,
browsers: ['ff >= 4', 'ie >= 8', 'safari >= 5.1', 'opera >= 12', 'chrome >=10'],
import: { path: ["node_modules"] }
import: { path: ['node_modules'] }
},
dist: {
files: {
'<%= cssPath %>/webcompat.dev.css': '<%= cssPath %>/development/main.css'
}
dist: {
files: {
'<%= cssPath %>/webcompat.dev.css': '<%= cssPath %>/development/main.css'
}
});
}
});
};
13 changes: 8 additions & 5 deletions grunt-tasks/eslint.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,12 @@

module.exports = function(grunt) {
grunt.config('eslint', {
target: [
'<%= jsPath %>/lib/*.js',
'tests/functional/*.js'
]
});
target: [
'<%= jsPath %>/lib/*.js',
'<%= jsPath %>/lib/mixins/*.js',
'<%= jsPath %>/lib/models/*.js',
'grunt-tasks/*.js',
'tests/functional/*.js'
]
});
};
4 changes: 2 additions & 2 deletions grunt-tasks/imagemin.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ module.exports = function(grunt) {
cwd: '<%= imgPath %>/',
src: ['*.jpg'],
dest: '<%= imgPath %>/'
}]
}
}]
}
});
};
58 changes: 29 additions & 29 deletions grunt-tasks/uglify.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,33 +4,33 @@

module.exports = function(grunt) {
grunt.config('uglify', {
options: {
banner: '<%= banner %>',
mangle: false
},
dist: {
src: '<%= concat.dist.dest %>',
dest: '<%= jsPath %>/<%= pkg.name %>.min.js'
},
issues: {
src: '<%= concat.issues.dest %>',
dest: '<%= jsPath %>/issues.min.js'
},
issueList: {
src: '<%= concat.issueList.dest %>',
dest: '<%= jsPath %>/issue-list.min.js'
},
userActivity: {
src: '<%= concat.userActivity.dest %>',
dest: '<%= jsPath %>/user-activity.min.js'
},
diagnose: {
src: '<%= concat.diagnose.dest %>',
dest: '<%= jsPath %>/diagnose.min.js'
},
cssFixmeLibs: {
src: '<%= concat.cssFixmeLibs.dest %>',
dest: '<%= jsPath %>/cssfixme.min.js'
}
});
options: {
banner: '<%= banner %>',
mangle: false
},
dist: {
src: '<%= concat.dist.dest %>',
dest: '<%= jsPath %>/<%= pkg.name %>.min.js'
},
issues: {
src: '<%= concat.issues.dest %>',
dest: '<%= jsPath %>/issues.min.js'
},
issueList: {
src: '<%= concat.issueList.dest %>',
dest: '<%= jsPath %>/issue-list.min.js'
},
userActivity: {
src: '<%= concat.userActivity.dest %>',
dest: '<%= jsPath %>/user-activity.min.js'
},
diagnose: {
src: '<%= concat.diagnose.dest %>',
dest: '<%= jsPath %>/diagnose.min.js'
},
cssFixmeLibs: {
src: '<%= concat.cssFixmeLibs.dest %>',
dest: '<%= jsPath %>/cssfixme.min.js'
}
});
};
Loading