Skip to content

Commit

Permalink
Merge pull request #5 from cytopia/license
Browse files Browse the repository at this point in the history
Adding license
  • Loading branch information
cytopia committed Apr 9, 2018
2 parents 61b45a1 + b57d67a commit 3047814
Show file tree
Hide file tree
Showing 29 changed files with 176 additions and 279 deletions.
43 changes: 20 additions & 23 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,40 +26,37 @@ before_install:
- sudo apt-get update -qq

# Install
- sudo apt-get install -qq ruby2.1 ruby-switch shellcheck moreutils php5 dos2unix
- sudo apt-get install -qq ruby2.3 ruby2.3-dev ruby-switch shellcheck moreutils php5 dos2unix

# Set ruby version
- sudo ruby-switch --set ruby2.1
#- sudo ruby-switch --set ruby2.3
- sudo gem update bundler
- sudo gem pristine executable-hooks --version 1.3.2
- sudo gem pristine gem-wrappers --version 1.3.2
- sudo gem pristine nokogiri --version 1.8.1
#- sudo gem pristine ffi --version 1.9.23

# Create custom source/bin directory
- sudo mkdir -p /usr/local/bin
- sudo mkdir -p /usr/local/src

# symlink alternative node binary
#- sudo ln -s "$(which nodejs)" /usr/local/bin/node

#- sudo apt-get install -qq shellcheck moreutils nodejs npm php5
#- sudo ln -s /usr/bin/nodejs /usr/bin/node
#- sudo apt-get install -qq

# NodeJS4
- VERSION="$( curl -Lq https://nodejs.org 2>/dev/null | grep LTS | grep -Eo 'data-version.*.' | grep -oE 'v[0-9.]+' )"
- sudo wget -P /usr/local/src https://nodejs.org/dist/${VERSION}/node-${VERSION}-linux-x64.tar.xz
- sudo tar xvf /usr/local/src/node-${VERSION}-linux-x64.tar.xz -C /usr/local/src
- sudo ln -s /usr/local/src/node-${VERSION}-linux-x64 /usr/local/node;
- sudo ln -s /usr/local/node/bin/* /usr/local/bin/


- sudo npm install -g eslint
- sudo npm install -g jsonlint
#- sudo npm install -g mdlint
- sudo gem install scss_lint
- sudo gem install mdl
#- sudo gem install mdl
#
- sudo gem install mdl -v 0.3.1

# Symlink node binaries
- sudo ln -s /usr/local/node/bin/* /usr/local/bin/ 2>/dev/null || true


# Install scripts
- ./configure
- sudo make install
Expand Down Expand Up @@ -98,7 +95,7 @@ script:
- bin/syntax-css --info
- bin/syntax-js --info
- bin/syntax-json --info
- bin/syntax-markdown --info
#- bin/syntax-markdown --info
- bin/syntax-perl --info
- bin/syntax-php --info
- bin/syntax-python --info
Expand Down Expand Up @@ -129,7 +126,7 @@ script:
- bin/syntax-css --path=. --config=etc/awesome-ci.conf --dry
- bin/syntax-js --path=. --config=etc/awesome-ci.conf --dry
- bin/syntax-json --path=. --config=etc/awesome-ci.conf --dry
- bin/syntax-markdown --path=. --config=etc/awesome-ci.conf --dry
#- bin/syntax-markdown --path=. --config=etc/awesome-ci.conf --dry
- bin/syntax-perl --path=. --config=etc/awesome-ci.conf --dry
- bin/syntax-php --path=. --config=etc/awesome-ci.conf --dry
- bin/syntax-python --path=. --config=etc/awesome-ci.conf --dry
Expand Down Expand Up @@ -210,9 +207,9 @@ script:
- bin/syntax-json --path=test/ok/ --config=etc/awesome-ci.conf --ignore=".git/,*.pyc,test/,configure.in" --verbose
- bin/syntax-json --path=test/ok/ --config=etc/awesome-ci.conf --ignore=".git/,*.pyc,test/,configure.in"

- bin/syntax-markdown --path=test/ok/ --config=etc/awesome-ci.conf --ignore=".git/,*.pyc,test/,configure.in" --list
- bin/syntax-markdown --path=test/ok/ --config=etc/awesome-ci.conf --ignore=".git/,*.pyc,test/,configure.in" --verbose
- bin/syntax-markdown --path=test/ok/ --config=etc/awesome-ci.conf --ignore=".git/,*.pyc,test/,configure.in"
#- bin/syntax-markdown --path=test/ok/ --config=etc/awesome-ci.conf --ignore=".git/,*.pyc,test/,configure.in" --list
#- bin/syntax-markdown --path=test/ok/ --config=etc/awesome-ci.conf --ignore=".git/,*.pyc,test/,configure.in" --verbose
#- bin/syntax-markdown --path=test/ok/ --config=etc/awesome-ci.conf --ignore=".git/,*.pyc,test/,configure.in"

- bin/syntax-perl --path=test/ok/ --config=etc/awesome-ci.conf --ignore=".git/,*.pyc,test/,configure.in" --list
- bin/syntax-perl --path=test/ok/ --config=etc/awesome-ci.conf --ignore=".git/,*.pyc,test/,configure.in" --verbose
Expand Down Expand Up @@ -295,8 +292,8 @@ script:
- if bin/syntax-json --path=test/err --config=etc/awesome-ci.conf --verbose; then false; else true; fi
- if bin/syntax-json --path=test/err --config=etc/awesome-ci.conf; then false; else true; fi

- if bin/syntax-markdown --path=test/err --config=etc/awesome-ci.conf --verbose; then false; else true; fi
- if bin/syntax-markdown --path=test/err --config=etc/awesome-ci.conf; then false; else true; fi
#- if bin/syntax-markdown --path=test/err --config=etc/awesome-ci.conf --verbose; then false; else true; fi
#- if bin/syntax-markdown --path=test/err --config=etc/awesome-ci.conf; then false; else true; fi

- if bin/syntax-perl --path=test/err --config=etc/awesome-ci.conf --verbose; then false; else true; fi
- if bin/syntax-perl --path=test/err --config=etc/awesome-ci.conf; then false; else true; fi
Expand Down Expand Up @@ -389,9 +386,9 @@ script:
- bin/syntax-json --path=test/ok --config=etc/awesome-ci.conf --verbose
- bin/syntax-json --path=test/ok --config=etc/awesome-ci.conf

- bin/syntax-markdown --path=test/ok --config=etc/awesome-ci.conf --list
- bin/syntax-markdown --path=test/ok --config=etc/awesome-ci.conf --verbose
- bin/syntax-markdown --path=test/ok --config=etc/awesome-ci.conf
#- bin/syntax-markdown --path=test/ok --config=etc/awesome-ci.conf --list
#- bin/syntax-markdown --path=test/ok --config=etc/awesome-ci.conf --verbose
#- bin/syntax-markdown --path=test/ok --config=etc/awesome-ci.conf

- bin/syntax-perl --path=test/ok --config=etc/awesome-ci.conf --list
- bin/syntax-perl --path=test/ok --config=etc/awesome-ci.conf --verbose
Expand Down
21 changes: 21 additions & 0 deletions LICENSE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2016 cytopia

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
14 changes: 9 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
[![OSX](https://raw.githubusercontent.com/cytopia/icons/master/64x64/osx.png)](https://www.apple.com/osx)



Lot's of tools for git, file and static source code analysis.

**Documentation**
Expand Down Expand Up @@ -60,6 +59,7 @@ All checks have the option to only check by one or more file **extensions**, by
| Regex | [regex-grep](bin/regex-grep) | | `egrep` (`grep -E`) regex version to scan files for an occurance. |
| Regex | [regex-perl](bin/regex-perl) | | `perl` regex version to scan files for an occurance. |


## Learn / validate

All of the above scripts offer the `--dry` option which will only show you the built command without actually executing it:
Expand All @@ -75,6 +75,7 @@ find . -type f -not \( -path "./.git*" -o -path "./.svn*" \) ! -size 0 -print0 |
xargs -0 -P 8 -n1 sh -c 'if [ -f "${1}" ]; then grep --color=always -inHE "if[[:space:]]*\[\[" "$1" || true; fi' --
```


## Fix

Some of the above scripts offer the `--fix` option (see table above), with which you are actually able to fix the problem.
Expand All @@ -96,7 +97,6 @@ In order to give you an idea, have a look at the compiled [Regex Contributions](
Please use pull requests to add useful checks.



## General Usage

* All tools share the same pattern (except `git-ignored`) and can be used with the same command line arguments.
Expand Down Expand Up @@ -129,12 +129,9 @@ Please use pull requests to add useful checks.
--help # Show help
--info # Show version of required binaries
--version # Show tool version

```




## Installation

### Install OSX
Expand All @@ -159,3 +156,10 @@ make install
./configure --prefix=/opt
make install
```


## License

[MIT License](LICENSE.md)

Copyright (c) 2016 [cytopia](https://github.com/cytopia)
15 changes: 5 additions & 10 deletions bin/file-cr
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@ MY_FIX_INFO=""
#
# Version
#
MY_VERSION="0.14"
MY_DATE="2016-11-01"
MY_VERSION="0.15"
MY_DATE="2018-04-09"

#
# Credits
Expand Down Expand Up @@ -408,15 +408,10 @@ check_config_file() {
# (defaults to 1 if impossible)
#
num_cpu() {
_num="$(getconf _NPROCESSORS_ONLN)"

# Worked
if [ "$?" = "0" ]; then
echo "${_num}"
return 0
else
if ! _num="$( getconf _NPROCESSORS_ONLN 2>/dev/null )"; then
echo "1"
return 1
else
echo "${_num}"
fi
}

Expand Down
15 changes: 5 additions & 10 deletions bin/file-crlf
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@ MY_FIX_INFO="dos2unix --version"
#
# Version
#
MY_VERSION="0.14"
MY_DATE="2016-11-01"
MY_VERSION="0.15"
MY_DATE="2018-04-09"

#
# Credits
Expand Down Expand Up @@ -408,15 +408,10 @@ check_config_file() {
# (defaults to 1 if impossible)
#
num_cpu() {
_num="$(getconf _NPROCESSORS_ONLN)"

# Worked
if [ "$?" = "0" ]; then
echo "${_num}"
return 0
else
if ! _num="$( getconf _NPROCESSORS_ONLN 2>/dev/null )"; then
echo "1"
return 1
else
echo "${_num}"
fi
}

Expand Down
15 changes: 5 additions & 10 deletions bin/file-empty
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@ MY_INFO="echo \"test is a built-in shell command\""
#
# Version
#
MY_VERSION="0.14"
MY_DATE="2016-11-01"
MY_VERSION="0.15"
MY_DATE="2018-04-09"

#
# Credits
Expand Down Expand Up @@ -405,15 +405,10 @@ check_config_file() {
# (defaults to 1 if impossible)
#
num_cpu() {
_num="$(getconf _NPROCESSORS_ONLN)"

# Worked
if [ "$?" = "0" ]; then
echo "${_num}"
return 0
else
if ! _num="$( getconf _NPROCESSORS_ONLN 2>/dev/null )"; then
echo "1"
return 1
else
echo "${_num}"
fi
}

Expand Down
15 changes: 5 additions & 10 deletions bin/file-nullbyte-char
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,8 @@ MY_FIX_INFO=""
#
# Version
#
MY_VERSION="0.14"
MY_DATE="2016-11-01"
MY_VERSION="0.15"
MY_DATE="2018-04-09"

#
# Credits
Expand Down Expand Up @@ -410,15 +410,10 @@ check_config_file() {
# (defaults to 1 if impossible)
#
num_cpu() {
_num="$(getconf _NPROCESSORS_ONLN)"

# Worked
if [ "$?" = "0" ]; then
echo "${_num}"
return 0
else
if ! _num="$( getconf _NPROCESSORS_ONLN 2>/dev/null )"; then
echo "1"
return 1
else
echo "${_num}"
fi
}

Expand Down
15 changes: 5 additions & 10 deletions bin/file-trailing-newline
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,8 @@ MY_INFO="aci-trailing-newline -v"
#
# Version
#
MY_VERSION="0.14"
MY_DATE="2016-11-01"
MY_VERSION="0.15"
MY_DATE="2018-04-09"

#
# Credits
Expand Down Expand Up @@ -407,15 +407,10 @@ check_config_file() {
# (defaults to 1 if impossible)
#
num_cpu() {
_num="$(getconf _NPROCESSORS_ONLN)"

# Worked
if [ "$?" = "0" ]; then
echo "${_num}"
return 0
else
if ! _num="$( getconf _NPROCESSORS_ONLN 2>/dev/null )"; then
echo "1"
return 1
else
echo "${_num}"
fi
}

Expand Down
15 changes: 5 additions & 10 deletions bin/file-trailing-single-newline
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@ MY_INFO="aci-trailing-newline -v"
#
# Version
#
MY_VERSION="0.14"
MY_DATE="2016-11-01"
MY_VERSION="0.15"
MY_DATE="2018-04-09"

#
# Credits
Expand Down Expand Up @@ -408,15 +408,10 @@ check_config_file() {
# (defaults to 1 if impossible)
#
num_cpu() {
_num="$(getconf _NPROCESSORS_ONLN)"

# Worked
if [ "$?" = "0" ]; then
echo "${_num}"
return 0
else
if ! _num="$( getconf _NPROCESSORS_ONLN 2>/dev/null )"; then
echo "1"
return 1
else
echo "${_num}"
fi
}

Expand Down
13 changes: 4 additions & 9 deletions bin/file-trailing-space
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ MY_INFO="grep -V | grep -E '([0-9]+\.+)+'"
# Version
#
MY_VERSION="0.15"
MY_DATE="2017-05-20"
MY_DATE="2018-04-09"

#
# Credits
Expand Down Expand Up @@ -408,15 +408,10 @@ check_config_file() {
# (defaults to 1 if impossible)
#
num_cpu() {
_num="$(getconf _NPROCESSORS_ONLN)"

# Worked
if [ "$?" = "0" ]; then
echo "${_num}"
return 0
else
if ! _num="$( getconf _NPROCESSORS_ONLN 2>/dev/null )"; then
echo "1"
return 1
else
echo "${_num}"
fi
}

Expand Down

0 comments on commit 3047814

Please sign in to comment.