Skip to content

Commit

Permalink
Merge pull request #205 from Kibibit/Build-System-major-changes
Browse files Browse the repository at this point in the history
[BUILD SYSTEM] Preparations for Milestone 2
  • Loading branch information
thatkookooguy authored Sep 8, 2016
2 parents d87b03b + 6aea0a5 commit 87a0352
Show file tree
Hide file tree
Showing 27 changed files with 1,731 additions and 224 deletions.
124 changes: 124 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,124 @@
{
'plugins': ['angular', 'lodash', 'kibibit'],
'rules': {
'angular/controller-as-vm': [2, 'vm'],
'angular/controller-name': [2, '/^[A-Z][a-zA-Z0-9]*Controller$/'],
'angular/di': [2, 'array'],
'angular/function-type': [2, 'named'],
'angular/one-dependency-per-line': 2,
'angular/module-dependency-order': [2, { 'grouped': true, 'prefix': 'app' }],
'angular/interval-service': 2,
'angular/json-functions': 2,
'angular/timeout-service': 2,
'angular/window-service': 2,
'lodash/prefer-is-nil': 2,
'lodash/prefer-lodash-typecheck': 2,
'lodash/prefer-startswith': 2,
'lodash/prefer-includes': 2,
'lodash/prefer-noop': 2,
'kibibit/lodash-typecheck-instead-of-angular': 1,
'kibibit/angular-modules-functions-order': 1,
'accessor-pairs': 'error',
'no-unused-vars': 'error',
'default-case': 'error',
'eqeqeq': 'error',
'no-extend-native': 'error',
'curly': [
2,
'all'
],
'operator-linebreak': [
2,
'after'
],
'camelcase': [
2,
{
'properties': 'always'
}
],
'max-len': [
2,
80
],
'indent': [
2,
2,
{
'SwitchCase': 1
}
],
'quotes': [
2,
'single'
],
'no-multi-str': 2,
'no-mixed-spaces-and-tabs': 2,
'no-trailing-spaces': 2,
'space-unary-ops': [
2,
{
'nonwords': false,
'overrides': {}
}
],
'one-var': [
2,
{
'uninitialized': 'always',
'initialized': 'never'
}
],
'brace-style': [
2,
'1tbs',
{
'allowSingleLine': true
}
],
'keyword-spacing': [
2,
{}
],
'space-infix-ops': 2,
'space-before-blocks': [
2,
'always'
],
'eol-last': 2,
'space-before-function-paren': [
2,
{
'anonymous': 'ignore',
'named': 'never'
}
],
'array-bracket-spacing': [
2,
'never',
{
'singleValue': true
}
],
'space-in-parens': [
2,
'never'
],
'no-multiple-empty-lines': 2,
'no-with': 2,
'no-spaced-func': 2,
'key-spacing': [
2,
{
'beforeColon': false,
'afterColon': true
}
],
'dot-notation': 2,
'semi': [
2,
'always'
],
'valid-jsdoc': 2
}
}
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
/coverage/**
/logs/**
/node_modules/**
/public/assets/css/style.css
/public/assets/lib/bower_components/**
/.idea/**
/public/dist/**
/public/assets/styleguide/**
/public/assets/css/**
6 changes: 3 additions & 3 deletions .hound.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
fail_on_violations: true
jscs:
eslint:
enabled: true
config_file: .jscsrc_hound
config_file: .eslintrc
javascript:
enabled: false
scss:
config_file: .scss.yml
config_file: .sass-lint.yml
182 changes: 182 additions & 0 deletions .sass-lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,182 @@
# sass-lint config generated by make-sass-lint-config v0.1.2
#
# The following scss-lint Linters are not yet supported by sass-lint:
# ChainedClasses, DisableLinterReason, ElsePlacement, PrivateNamingConvention
# PropertyCount, PseudoElement, SelectorDepth, SpaceAfterVariableColon
# SpaceAroundOperator, TrailingWhitespace, UnnecessaryParentReference, Compass::*
#
# The following settings/values are unsupported by sass-lint:
# Linter Comment, option "style"
# Linter Indentation, option "allow_non_nested_indentation"
# Linter Indentation, option "character"
# Linter NestingDepth, option "ignore_parent_selectors"
# Linter PropertySortOrder, option "min_properties"
# Linter PropertySortOrder, option "separate_groups"
# Linter PropertySpelling, option "disabled_properties"
# Linter SpaceBeforeBrace, option "allow_single_line_padding"
# Linter VendorPrefix, option "identifier_list"

files:
include: '**/*.scss'
options:
formatter: stylish
merge-default-rules: false
rules:
bem-depth:
- 0
- max-depth: 1
border-zero:
- 2
- convention: zero
brace-style:
- 2
- allow-single-line: true
class-name-format:
- 2
- convention: hyphenatedlowercase
clean-import-paths:
- 2
- filename-extension: false
leading-underscore: false
empty-line-between-blocks:
- 2
- ignore-single-line-rulesets: true
extends-before-declarations: 1
extends-before-mixins: 1
final-newline:
- 2
- include: true
force-attribute-nesting: 1
force-element-nesting: 1
force-pseudo-nesting: 1
function-name-format:
- 2
- allow-leading-underscore: true
convention: hyphenatedlowercase
hex-length:
- 0
- style: short
hex-notation:
- 2
- style: lowercase
id-name-format:
- 2
- convention: hyphenatedlowercase
indentation:
- 2
- size: 2
leading-zero:
- 2
- include: true
mixin-name-format:
- 2
- allow-leading-underscore: true
convention: hyphenatedlowercase
mixins-before-declarations: 1
nesting-depth:
- 2
- max-depth: 4
no-color-keywords: 2
no-color-literals: 2
no-css-comments: 2
no-debug: 2
no-duplicate-properties: 2
no-empty-rulesets: 2
no-extends: 0
no-ids: 2
no-important: 2
no-invalid-hex: 2
no-mergeable-selectors: 2
no-misspelled-properties:
- 2
- extra-properties: []
no-qualifying-elements:
- 2
- allow-element-with-attribute: false
allow-element-with-class: false
allow-element-with-id: false
no-trailing-zero: 2
no-transition-all: 0
no-url-protocols: 2
no-vendor-prefixes:
- 2
- additional-identifiers: []
excluded-identifiers: []
placeholder-in-extend: 0
placeholder-name-format:
- 2
- convention: hyphenatedlowercase
property-sort-order:
- 2
- ignore-custom-properties: false
property-units:
- 2
- global:
- ch
- em
- ex
- rem
- cm
- in
- mm
- pc
- pt
- px
- q
- vh
- vw
- vmin
- vmax
- deg
- grad
- rad
- turn
- ms
- s
- Hz
- kHz
- dpi
- dpcm
- dppx
- '%'
per-property: {}
quotes:
- 2
- style: single
shorthand-values:
- 2
- allowed-shorthands:
- 1
- 2
- 3
single-line-per-selector: 1
space-after-bang:
- 2
- include: false
space-after-colon:
- 2
- include: true
space-after-comma:
- 2
- include: true
space-before-bang:
- 2
- include: true
space-before-brace:
- 2
- include: true
space-before-colon: 1
space-between-parens:
- 2
- include: false
trailing-semicolon: 1
url-quotes: 1
variable-for-property:
- 0
- properties: []
variable-name-format:
- 2
- allow-leading-underscore: true
convention: hyphenatedlowercase
zero-unit: 1

66 changes: 66 additions & 0 deletions analyzeCode.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
var gulp = require('gulp');
var plugins = require('gulp-load-plugins')({
rename: {
'gulp-buddy.js': 'buddy'
}
});

var buildConfig = require('../buildConfig');
var stripAnsi = require('strip-ansi');

module.exports = function() {
gulp.task('analyzeCode',
'run all sort of checks on styleguides and complexity',
['jscpd', 'magicNumbers']
);

gulp.task('jscpd',
//'finds out duplicate part of codes inside your project',
function() {
plugins.notify.logLevel(0);

return gulp.src(
[].concat(
buildConfig.FILES.LINT_JS,
buildConfig.FILES.FRONTEND_SASS))
.pipe(plugins.plumber(buildConfig.options.plumber))
.pipe(plugins.if(buildConfig.flags.watch,
plugins.cached('jscpd')))
.pipe(plugins.jscpd({
'min-lines': 10,
verbose: true
}))
.on('error', buildConfig.flags.watch
? plugins.notify.onError(function(error) {
return stripAnsi(error.message);
}) : function() {});
}
);

gulp.task('magicNumbers',
//'shows you if you have any magic numbers
// + '(numbers that are used inline in javascript)',
function () {
return gulp.src(buildConfig.FILES.JS_ALL)
.pipe(plugins.plumber(buildConfig.options.plumber))
.pipe(plugins.if(buildConfig.flags.watch,
plugins.cached('magicNumbers')))
.pipe(plugins.buddy({
reporter: 'detailed'
}))
.on('error', buildConfig.flags.watch ?
plugins.notify.onError(function(error) {
return 'found new magic numbers!';
}) : function() {});
}
);

// gulp.task('depcheck',
// 'checks for unused dependencies ' + colors.blue('(including devs)'),
// depcheck({
// ignoreDirs: ['test', 'logs'],
// ignoreMatches: ['karma-*', 'jscs-*', 'jasmine-*']
// })
// );

};
Loading

0 comments on commit 87a0352

Please sign in to comment.