Browse Source

Added support for scss-lint in Hound and Makefile.

pull/176/head
Simon Eisenmann 11 years ago
parent
commit
c333c7bf0a
  1. 4
      .hound.yml
  2. 3
      Makefile.am
  3. 19
      README.md
  4. 10
      configure.ac
  5. 5
      package.json
  6. 4
      src/styles/Makefile.am
  7. 2
      src/styles/_shame.scss
  8. 189
      src/styles/scss.yml

4
.hound.yml

@ -2,3 +2,7 @@ java_script: @@ -2,3 +2,7 @@ java_script:
enabled: true
config_file: .jshint
ignore_file: .javascript_ignore
scss:
enabled: true
config_file: .scss.yml

3
Makefile.am

@ -95,6 +95,9 @@ styles: fonts @@ -95,6 +95,9 @@ styles: fonts
styleshint:
cd $(CURDIR)/src/styles && $(MAKE) styleshint
styleslint:
cd $(CURDIR)/src/styles && $(MAKE) styleslint
jshint:
@if [ "$(JSHINT)" = "" ]; then echo "Command 'jshint' not found"; exit 1; fi
$(FIND) static/ -wholename static/js/libs -prune -o -name "*.js" -print0 | xargs -0 -n1 $(JSHINT) --config .jshint

19
README.md

@ -1,8 +1,10 @@ @@ -1,8 +1,10 @@
Spreed WebRTC
===================
The latest version of Spreed WebRTC can be found on GitHub:
Spreed WebRTC implements a WebRTC audio/video call and conferencing server
and web client.
The latest version of Spreed WebRTC can be found on GitHub:
https://github.com/strukturag/spreed-webrtc
@ -17,7 +19,8 @@ The latest version of Spreed WebRTC can be found on GitHub: @@ -17,7 +19,8 @@ The latest version of Spreed WebRTC can be found on GitHub:
## Runtime dependencies
Spreed WebRTC compiles directly to native code and has no
external runtime dependencies. See http://golang.org/doc/faq#How_is_the_run_time_support_implemented for details.
external runtime dependencies. See [here](http://golang.org/doc/faq#How_is_the_run_time_support_implemented)
for details.
## Building
@ -87,12 +90,14 @@ The latest version of Spreed WebRTC can be found on GitHub: @@ -87,12 +90,14 @@ The latest version of Spreed WebRTC can be found on GitHub:
locally by running `npm install` from the project root. Consult the
`package.json` file for more details.
- [JSHint](http://www.jshint.com/) >= 2.0.0
- [autoprefixer](https://www.npmjs.org/package/autoprefixer) >= 1.1
- [po2json](https://github.com/mikeedwards/po2json)
- [JSHint](http://www.jshint.com/) >= 2.0.0
- [scss-lint](https://github.com/causes/scss-lint) >= 0.33.0
Styles can be found in src/styles. Translations are found in src/i18n.
Each folder has its own Makefile to build the corresponding files.
Each folder has its own Makefile to build the corresponding files. Check the
Makefile.am templates for available make targets.
## Running server for development
@ -124,11 +129,11 @@ The latest version of Spreed WebRTC can be found on GitHub: @@ -124,11 +129,11 @@ The latest version of Spreed WebRTC can be found on GitHub:
## Contributing
1. "Fork".
2. Make a feature branch.
1. "Fork" develop branch.
2. Create a feature branch.
3. Make changes.
4. Do your commits (run ``make fmt`` and ``make jshint`` before commit).
5. Send "pull request".
5. Send "pull request" for develop branch.
## License

10
configure.ac

@ -37,6 +37,7 @@ GO_VERSION_MIN=1.1 @@ -37,6 +37,7 @@ GO_VERSION_MIN=1.1
NODEJS_VERSION_MIN=0.6.0
NODEJS_VERSION_STYLES_MIN=0.10.0
SASS_VERSION_MIN=3.3.0
SCSS_LINT_VERSION_MIN=0.33.0
AC_CONFIG_SRCDIR([src/app/spreed-webrtc-server/main.go])
AC_CONFIG_MACRO_DIR([m4])
@ -123,6 +124,15 @@ else @@ -123,6 +124,15 @@ else
SASS_SUPPORT_STYLES=no],[SASS_SUPPORT_STYLES=yes])
fi
AC_PATH_PROG([SCSS_LINT],scss-lint, [], [$PWD/node_modules/.bin$PATH_SEPARATOR$PATH])
if test x"${SCSS_LINT}" == x"" ; then
AC_MSG_WARN([Please install scss-lint to lint styles.])
else
AC_MSG_CHECKING([for version of scss-lint])
SCSS_LINT_VERSION=`$SCSS_LINT --version | $SED 's/^scss-lint //' | $SED 's/ .*//'`
AC_MSG_RESULT([$SCSS_LINT_VERSION])
fi
if test x"${SASS}" != x"" ; then
AC_MSG_CHECKING([for compass support in sass])
tempfile=`mktemp -t XXXXXXblah`

5
package.json

@ -1,8 +1,9 @@ @@ -1,8 +1,9 @@
{
"private": true,
"dependencies": {
"jshint": ">= 2.5.5",
"autoprefixer": ">= 3.1.0",
"po2json": ">= 0.3.0"
"po2json": ">= 0.3.0",
"jshint": ">= 2.5.5",
"scss-lint": ">= 0.33.0"
}
}

4
src/styles/Makefile.am

@ -43,3 +43,7 @@ styleshint: @@ -43,3 +43,7 @@ styleshint:
@if [ "$(SASS)" = "" ]; then echo "Command 'sass' not found, required when checking styles"; exit 1; fi
@if [ "$(SASS_SUPPORT_STYLES)" = "no" ]; then echo "Your version of sass does not support checking styles"; exit 1; fi
$(FIND) ./ -maxdepth 1 -name "*.scss" -print0 | xargs -0 -n1 $(SASS) --compass --scss $(SASSFLAGS) -c
styleslint:
@if [ "$(SCSS_LINT)" = "" ]; then echo "Command 'scss-lint' not found, required when linting styles"; exit 1; fi
$(SCSS_LINT) -c scss.yml

2
src/styles/_shame.scss

@ -19,6 +19,8 @@ @@ -19,6 +19,8 @@
*
*/
// scss-lint:disable IdSelector
// Remove boostrap 3 modal scroll bar.
.modal {
overflow-y: auto;

189
src/styles/scss.yml

@ -0,0 +1,189 @@ @@ -0,0 +1,189 @@
scss_files: "**/*.scss"
exclude: "libs/**"
linters:
BangFormat:
enabled: true
space_before_bang: true
space_after_bang: false
BorderZero:
enabled: true
convention: zero # or `none`
ColorKeyword:
enabled: true
ColorVariable:
enabled: true
Comment:
enabled: false
DebugStatement:
enabled: true
DeclarationOrder:
enabled: true
DuplicateProperty:
enabled: true
ElsePlacement:
enabled: true
style: same_line # or 'new_line'
EmptyLineBetweenBlocks:
enabled: true
ignore_single_line_blocks: true
EmptyRule:
enabled: false
FinalNewline:
enabled: true
present: true
HexLength:
enabled: true
style: short # or 'long'
HexNotation:
enabled: true
style: lowercase # or 'uppercase'
HexValidation:
enabled: true
IdSelector:
enabled: true
ImportantRule:
enabled: true
ImportPath:
enabled: true
leading_underscore: false
filename_extension: false
Indentation:
enabled: true
allow_non_nested_indentation: false
character: space # or 'tab'
width: 2
LeadingZero:
enabled: true
style: exclude_zero # or 'include_zero'
MergeableSelector:
enabled: true
force_nesting: true
NameFormat:
enabled: true
allow_leading_underscore: true
convention: hyphenated_lowercase # or 'BEM', or a regex pattern
NestingDepth:
enabled: true
max_depth: 3
PlaceholderInExtend:
enabled: true
PropertyCount:
enabled: false
include_nested: false
max_properties: 10
PropertySortOrder:
enabled: true
ignore_unspecified: false
separate_groups: false
PropertySpelling:
enabled: true
extra_properties: []
QualifyingElement:
enabled: true
allow_element_with_attribute: false
allow_element_with_class: false
allow_element_with_id: false
SelectorDepth:
enabled: true
max_depth: 3
SelectorFormat:
enabled: true
convention: hyphenated_lowercase # or 'BEM', or 'hyphenated_BEM', or 'snake_case', or 'camel_case', or a regex pattern
Shorthand:
enabled: true
SingleLinePerProperty:
enabled: true
allow_single_line_rule_sets: true
SingleLinePerSelector:
enabled: true
SpaceAfterComma:
enabled: true
SpaceAfterPropertyColon:
enabled: true
style: one_space # or 'no_space', or 'at_least_one_space', or 'aligned'
SpaceAfterPropertyName:
enabled: true
SpaceBeforeBrace:
enabled: true
style: space # or 'new_line'
allow_single_line_padding: false
SpaceBetweenParens:
enabled: true
spaces: 0
StringQuotes:
enabled: true
style: single_quotes # or double_quotes
TrailingSemicolon:
enabled: true
TrailingZero:
enabled: false
UnnecessaryMantissa:
enabled: true
UnnecessaryParentReference:
enabled: true
UrlFormat:
enabled: true
UrlQuotes:
enabled: true
VariableForProperty:
enabled: false
properties: []
VendorPrefixes:
enabled: true
identifier_list: base
include: []
exclude: []
ZeroUnit:
enabled: true
Compass::*:
enabled: true
Loading…
Cancel
Save