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. 119
      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

119
README.md

@ -1,9 +1,11 @@ @@ -1,9 +1,11 @@
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.
https://github.com/strukturag/spreed-webrtc
The latest version of Spreed WebRTC can be found on GitHub:
https://github.com/strukturag/spreed-webrtc
## Build prerequisites
@ -16,119 +18,122 @@ The latest version of Spreed WebRTC can be found on GitHub: @@ -16,119 +18,122 @@ 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.
Spreed WebRTC compiles directly to native code and has no
external runtime dependencies. See [here](http://golang.org/doc/faq#How_is_the_run_time_support_implemented)
for details.
## Building
[![Build Status](https://travis-ci.org/strukturag/spreed-webrtc.png?branch=master)](https://travis-ci.org/strukturag/spreed-webrtc)
[![Build Status](https://travis-ci.org/strukturag/spreed-webrtc.png?branch=master)](https://travis-ci.org/strukturag/spreed-webrtc)
If you got spreed-webrtc from the git repository, you will first need
to run the included `autogen.sh` script to generate the `configure`
script.
If you got spreed-webrtc from the git repository, you will first need
to run the included `autogen.sh` script to generate the `configure`
script.
Configure does try to find all the tools on your system at the standard
locations. If the dependencies are somewhere else, add the corresponding
parameters to the ./configure call.
Configure does try to find all the tools on your system at the standard
locations. If the dependencies are somewhere else, add the corresponding
parameters to the ./configure call.
```bash
$ ./configure
$ make
```bash
$ ./configure
$ make
```
## Build seperately
Get Go external dependencies first with ``make get``.
Get Go external dependencies first with ``make get``.
```bash
$ make assets
$ make binary
```
```bash
$ make assets
$ make binary
```
## Server startup
```bash
spreed-webrtc-server [OPTIONS]
```
```bash
spreed-webrtc-server [OPTIONS]
```
Options
Options
-c="./server.conf": Configuration file.
-cpuprofile="": Write cpu profile to file.
-h=false: Show this usage information and exit.
-l="": Log file, defaults to stderr.
-memprofile="": Write memory profile to this file.
-v=false: Display version number and exit.
-c="./server.conf": Configuration file.
-cpuprofile="": Write cpu profile to file.
-h=false: Show this usage information and exit.
-l="": Log file, defaults to stderr.
-memprofile="": Write memory profile to this file.
-v=false: Display version number and exit.
An example configuration file can be found in server.conf.in.
An example configuration file can be found in server.conf.in.
## Usage
Connect to the server URL and port with a web browser and the
web client will launch.
Connect to the server URL and port with a web browser and the
web client will launch.
## Development
To build styles and translations, further dependencies are required.
The source tree contains already built styles and translations, so
these are only required if you want to make changes.
To build styles and translations, further dependencies are required.
The source tree contains already built styles and translations, so
these are only required if you want to make changes.
- [NodeJS](http://nodejs.org/) >= 0.10.0
- [Compass](http://compass-style.org/) >= 1.0.0
- [Sass](http://sass-lang.com/) >= 3.3.0
- [Babel](http://babel.pocoo.org/)
The following Node.js modules are required, these may be installed
locally by running `npm install` from the project root. Consult the
`package.json` file for more details.
The following Node.js modules are required, these may be installed
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
Copy the server.conf.in to server.conf.
Copy the server.conf.in to server.conf.
Build styles, javascript and binary using make. Then run
``./spreed-webrtc-server``
Build styles, javascript and binary using make. Then run
``./spreed-webrtc-server``
The server runs on http://localhost:8080/ per default.
The server runs on http://localhost:8080/ per default.
HTML changes and Go rebuilds need a server restart. Javascript
and CSS reload directly.
HTML changes and Go rebuilds need a server restart. Javascript
and CSS reload directly.
## Running for production
Spreed WebRTC should be run through a SSL frontend proxy with
support for Websockets. Example configuration for Nginx can be
found in `doc/NGINX.txt`.
Spreed WebRTC should be run through a SSL frontend proxy with
support for Websockets. Example configuration for Nginx can be
found in `doc/NGINX.txt`.
In addion for real work use one also needs a STUN/TURN server
configured with shared secret support.
In addion for real work use one also needs a STUN/TURN server
configured with shared secret support.
See https://code.google.com/p/rfc5766-turn-server/ for a free
open source TURN server implementation. Make sure to use a recent
version (We recommend 3.2). Versions below 2.5 are not supported.
See https://code.google.com/p/rfc5766-turn-server/ for a free
open source TURN server implementation. Make sure to use a recent
version (We recommend 3.2). Versions below 2.5 are not supported.
## 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