Skip to content

Commit

Permalink
Merge branch 'master' into 464-enum-trailing-comma
Browse files Browse the repository at this point in the history
# Conflicts:
#	eclipsecs-sevntu-plugin/src/com/github/sevntu/checkstyle/checks/coding/checkstyle-metadata.properties
#	eclipsecs-sevntu-plugin/src/com/github/sevntu/checkstyle/checks/coding/checkstyle-metadata.xml
#	sevntu-checks/sevntu-checks.xml
#	sevntu-checks/src/main/java/com/github/sevntu/checkstyle/checks/coding/NumericLiteralNeedsUnderscoreCheck.java
#	sevntu-checks/src/main/resources/com/github/sevntu/checkstyle/checks/coding/messages.properties
#	sevntu-checks/src/test/java/com/github/sevntu/checkstyle/internal/CommitValidationTest.java
  • Loading branch information
kariem committed Jul 26, 2018
2 parents cdc74e8 + 0c7b77a commit 0b25a9b
Show file tree
Hide file tree
Showing 368 changed files with 10,691 additions and 4,328 deletions.
100 changes: 100 additions & 0 deletions .ci/travis.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
#!/bin/bash
# Attention, there is no "-x" to avoid problems on Travis
set -e

case $1 in

pr-description)
.ci/xtr_pr-description.sh
;;

eclipse-cs)
cd sevntu-checks
mvn -e clean install -Dmaven.test.skip=true -Dcheckstyle.skip=true -Dcobertura.skip=true
cd ..
git clone https://github.com/checkstyle/eclipse-cs.git
cd eclipse-cs/
git checkout 8.10.0
mvn -e install
cd ../
cd eclipsecs-sevntu-plugin
mvn -e verify
mvn -e javadoc:javadoc
;;

maven-plugin)
cd sevntu-checks
mvn -e clean install -Dmaven.test.skip=true -Dcheckstyle.skip=true -Dcobertura.skip=true
cd ..
cd sevntu-checkstyle-maven-plugin
mvn -e verify
mvn -e javadoc:javadoc
;;

idea-extension)
cd sevntu-checks
mvn -e clean install -Dmaven.test.skip=true -Dcheckstyle.skip=true -Dcobertura.skip=true
cd ..
cd sevntu-checkstyle-idea-extension
mvn -e verify
mvn -e javadoc:javadoc
;;

sonar-plugin)
cd sevntu-checks
mvn -e clean install -Dmaven.test.skip=true -Dcheckstyle.skip=true -Dcobertura.skip=true
cd ..
cd sevntu-checkstyle-sonar-plugin
mvn -e verify
mvn -e javadoc:javadoc
;;

sevntu-checks)
cd sevntu-checks
mvn -e -Pcoverall install
mvn -e verify -Pno-validations,selftesting
mvn -e javadoc:javadoc
if [[ $TRAVIS == 'true' ]]; then
mvn -e -Pcoverall jacoco:report coveralls:report
fi
;;

all-sevntu-checks-contribution)
wget -q \
https://raw.githubusercontent.com/checkstyle/contribution/master/checkstyle-tester/checks-sevntu-error.xml
xmlstarlet sel --net --template -m .//module -v "@name" -n checks-sevntu-error.xml \
| grep -vE "Checker|TreeWalker|Filter|Holder" | grep -v "^$" \
| sed "s/com\.github\.sevntu\.checkstyle\.checks\..*\.//" \
| sort | uniq | sed "s/Check$//" > web.txt
xmlstarlet sel --net --template -m .//module -v "@name" -n sevntu-checks/sevntu-checks.xml \
| grep -vE "Checker|TreeWalker|Filter|Holder" | grep -v "^$" \
| sed "s/com\.github\.sevntu\.checkstyle\.checks\..*\.//" \
| sort | uniq | sed "s/Check$//" > file.txt
diff -u web.txt file.txt
;;

checkstyle-regression)
git clone https://github.com/checkstyle/checkstyle
cd sevntu-checks
mvn -e install -DskipTests -Dcheckstyle.skip=true -Dcobertura.skip=true
mvn -e test -Dtest=CheckstyleRegressionTest#setupFiles -Dregression-path=../
cd ../
cd checkstyle
mvn -e clean verify -e -DskipTests -DskipITs -Dpmd.skip=true \
-Dfindbugs.skip=true -Dcobertura.skip=true \
-Dmaven.sevntu-checkstyle-check.checkstyle.version=8.10
;;

eclipse-analysis)
cd sevntu-checks
mvn -e clean compile exec:exec -Peclipse-compiler
;;


*)
echo "Unexpected argument: $1"
sleep 5s
false
;;

esac
29 changes: 29 additions & 0 deletions .ci/xtr_pr-description.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#!/bin/bash
# Attention, there is no "-x" to avoid problems on Travis
set -e

if [[ ! $TRAVIS_PULL_REQUEST =~ ^([0-9]*)$ ]]; then exit 0; fi
LINK_COMMITS=https://api.github.com/repos/sevntu-checkstyle/sevntu.checkstyle/pulls/$TRAVIS_PULL_REQUEST/commits
COMMITS=$(curl -s -H "Authorization: token $READ_ONLY_TOKEN" $LINK_COMMITS | jq '.[0] | .commit.message')
echo 'Commit messages from github: '${COMMITS:0:60}...
ISSUE_NUMBER=$(echo $COMMITS | sed -e 's/^.*Issue //' | sed -e 's/:.*//')
echo 'Issue number: '$ISSUE_NUMBER && RESULT=0
if [[ $ISSUE_NUMBER =~ ^#[0-9]+$ ]]; then
LINK_PR=https://api.github.com/repos/sevntu-checkstyle/sevntu.checkstyle/pulls/$TRAVIS_PULL_REQUEST
LINK_ISSUE=https://api.github.com/repos/sevntu-checkstyle/sevntu.checkstyle/issues/${ISSUE_NUMBER:1}
REGEXP=($ISSUE_NUMBER\|https://github.com/sevntu-checkstyle/sevntu.checkstyle/issues/${ISSUE_NUMBER:1})
PR_DESC=$(curl -s -H "Authorization: token $READ_ONLY_TOKEN" $LINK_PR | jq '.body' | grep -E $REGEXP | cat )
echo 'PR Description grepped:'${PR_DESC:0:80}
if [[ -z $PR_DESC ]]; then
echo 'Please put a reference to an Issue in the PR description, this will bind the Issue to your PR in Github' && RESULT=1;
fi
LABEL_APRV=$(curl -s -H "Authorization: token $READ_ONLY_TOKEN" $LINK_ISSUE | jq '.labels [] | .name' | grep approved | cat | wc -l )
if [[ $LABEL_APRV == 0 ]]; then
echo 'You are providing a PR for an Issue that is not approved yet, please ask admins to approve your Issue first' && RESULT=1;
fi
fi
if [[ $RESULT == 0 ]]; then
echo 'PR validation succeeded.';
else
echo 'PR validation failed.' && false;
fi
11 changes: 11 additions & 0 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
Please read http://checkstyle.sourceforge.net/report_issue.html

**Note:** Sevntu checks are in a different JAR from the main Checkstyle JAR and cannot be run without the main JAR.
The command to run sevntu in the Command Line Interface (CLI) is slightly different as noted below:
```
java -classpath sevntu-checks-X.XX.X.jar;checkstyle-X.XX-all.jar com.puppycrawl.tools.checkstyle.Main -c config.xml YOUR_FILE.java
```

Please provide issue report in format that we request, EACH DETAIL MAKE A HUGE HELP.

Issues that are not following the guidelines, will be processed with last priority.
29 changes: 29 additions & 0 deletions .github/ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
/var/tmp $ javac YOUR_FILE.java

[[PLACE YOUR OUTPUT HERE]]

/var/tmp $ cat YOUR_FILE.java

[[PLACE YOU OUTPUT HERE]]

/var/tmp $ cat config.xml

[[PLACE YOUR OUTPUT HERE]]

For Linux users:

`/var/tmp $ java -classpath sevntu-checks-X.XX.X.jar:checkstyle-X.XX-all.jar com.puppycrawl.tools.checkstyle.Main -c config.xml YOUR_FILE.java`

For Windows users:

`C:\tmp> java -classpath sevntu-checks-X.XX.X.jar;checkstyle-X.XX-all.jar com.puppycrawl.tools.checkstyle.Main -c config.xml YOUR_FILE.java`

[[PLACE YOUR OUTPUT HERE]]

---------------

Describe what you expect in detail.

--------------

Still not clear ??? - see example - https://github.com/sevntu-checkstyle/sevntu.checkstyle/wiki/How-to-report-the-issue-(example)
16 changes: 16 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
Mandatory to understand and do:
0) Issue you are trying to fix/resolve has to have "approved" label.
1) Put in description of Pull Request reference to issue if it exists. Example: "Issue: #XXXXXX"
2) Commit message should adhere to the following rules:
a) Must match one of the following patterns:\n"
^Issue #\\d+: .*$
^Pull #\\d+: .*$
^(minor|config|infra|doc|spelling): .*$
b) It contains only one line of text
c) Must not end with a period, space, or tab

To avoid multiple iterations of fixes and CIs failures, please read http://checkstyle.sourceforge.net/contributing.html

ATTENTION: We are not merging Pull Requests that not passing our CIs, but we help to resolve issues.

Thanks for reading, remove whole this message and type what you need.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,11 @@ bin/
# No Github Pages
gh-pages/

# No Eclipse settings
# No Eclipse files
.settings/
.checkstyle
.classpath
.project

# No IntelliJ Idea project files
.idea/
Expand Down
107 changes: 89 additions & 18 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,31 +1,102 @@
language: java
sudo: false

jdk:
- oraclejdk8

before_install: git clone git://git.code.sf.net/p/eclipse-cs/git eclipse-cs-git
&& cd eclipse-cs-git/ && git checkout 7.2.0
&& cd net.sf.eclipsecs.parent/ && mvn install
&& cd ../../

install: cd sevntu-checks && mvn clean install && mvn javadoc:javadoc
&& cd ../eclipsecs-sevntu-plugin && mvn verify && mvn javadoc:javadoc
&& cd ../sevntu-checkstyle-maven-plugin && mvn verify && mvn javadoc:javadoc
&& cd ../sevntu-checkstyle-idea-extension && mvn verify && mvn javadoc:javadoc
&& cd ../sevntu-checkstyle-sonar-plugin && mvn verify && mvn javadoc:javadoc
&& cd ../sevntu-checks && mvn jacoco:report coveralls:jacoco
&& cd ../sevntu-checks && mvn verify -Pselftesting

after_success:

cache:
directories:
- ~/.m2

addons:
apt:
packages:
- xmlstarlet

branches:
only:
- master

install:
-

matrix:
fast_finish: true
include:
# eclipse-cs
- jdk: oraclejdk8
env:
- DESC="eclipse-cs"
- CMD="./.ci/travis.sh eclipse-cs"

# maven-plugin
- jdk: oraclejdk8
env:
- DESC="maven-plugin"
- CMD="./.ci/travis.sh maven-plugin"

# idea-extension
- jdk: oraclejdk8
env:
- DESC="idea-extension"
- CMD="./.ci/travis.sh idea-extension"

# sonar-plugin
- jdk: oraclejdk8
env:
- DESC="sonar-plugin"
- CMD="./.ci/travis.sh sonar-plugin"

# checks
- jdk: oraclejdk8
env:
- DESC="checks"
- CMD="./.ci/travis.sh sevntu-checks"

# Ensure that all sevntu checks are used in contribution
- jdk: oraclejdk8
env:
- DESC="All sevntu checks should be used in contribution"
- CMD="./.ci/travis.sh all-sevntu-checks-contribution"

# regression on checkstyle
- jdk: oraclejdk8
env:
- DESC="checkstyle-regression"
- CMD="./.ci/travis.sh checkstyle-regression"

# eclipse static analysis
- jdk: oraclejdk8
env:
- DESC="eclipse-analysis"
- CMD="./.ci/travis.sh eclipse-analysis"

# testing of PR format
- env:
- DESC="test Issue ref in PR description"
- CMD="./.ci/travis.sh pr-description"


script:
- SKIP_FILES1=".github|codeship-*|buddy.yml|appveyor.yml|circleci|distelli-manifest.yml"
- SKIP_FILES2="|fast-forward-merge.sh|LICENSE|LICENSE.apache20|README.md|release.sh|RIGHTS.antlr"
- SKIP_FILES3="|shippable.yml|shippable.sh|wercker.yml|wercker.sh|intellij-idea-inspections.xml"
- SKIP_FILES=$SKIP_FILES1$SKIP_FILES2$SKIP_FILES3
- |
if [[ $SKIP_CI != 'false' ]]; then
if [[ $(git diff --name-only HEAD HEAD~1 | grep -vE "$SKIP_FILES" \
| cat | wc -c | sed 's/^ *//' ) > 0 ]]; then
SKIP_CI="false"
else
SKIP_CI="true"
fi
fi
- echo "SKIP_CI="$SKIP_CI
- |
set -e
if [[ $SKIP_CI == 'false' ]];
then
eval $CMD;
echo "eval of CMD is completed"
else
echo "CI is skipped"
fi
after_success:
15 changes: 12 additions & 3 deletions README.textile
Original file line number Diff line number Diff line change
@@ -1,11 +1,20 @@
h3. Information "!https://secure.travis-ci.org/sevntu-checkstyle/sevntu.checkstyle.png!":http://travis-ci.org/sevntu-checkstyle/sevntu.checkstyle/builds !https://coveralls.io/repos/sevntu-checkstyle/sevntu.checkstyle/badge.svg?branch=master&service=github(Coverage Status)!:https://coveralls.io/github/sevntu-checkstyle/sevntu.checkstyle?branch=master !https://img.shields.io/sonar/http/sonarqube.com/com.github.sevntu.checkstyle:sevntu-checks/tech_debt.svg?label=SonarQube%20tech%20debt!:https://sonarqube.com/overview?id=com.github.sevntu.checkstyle%3Asevntu-checks
h3. Information "!https://secure.travis-ci.org/sevntu-checkstyle/sevntu.checkstyle.png!":http://travis-ci.org/sevntu-checkstyle/sevntu.checkstyle/builds !https://coveralls.io/repos/sevntu-checkstyle/sevntu.checkstyle/badge.svg?branch=master&service=github(Coverage Status)!:https://coveralls.io/github/sevntu-checkstyle/sevntu.checkstyle?branch=master !https://sonarcloud.io/api/project_badges/measure?project=com.github.sevntu.checkstyle%3Asevntu-checks&metric=sqale_index!:https://sonarqube.com/dashboard?id=com.github.sevntu.checkstyle%3Asevntu-checks

sevntu-checks: !https://maven-badges.herokuapp.com/maven-central/com.github.sevntu-checkstyle/sevntu-checks/badge.svg!:https://search.maven.org/#search|gav|1|g%3A%22com.github.sevntu-checkstyle%22%20AND%20a%3A%22sevntu-checks%22
sevntu-checkstyle-idea-extension:!https://maven-badges.herokuapp.com/maven-central/com.github.sevntu-checkstyle/sevntu-checkstyle-idea-extension/badge.svg!:https://search.maven.org/#search|gav|1|g%3A%22com.github.sevntu-checkstyle%22%20AND%20a%3A%22sevntu-checkstyle-idea-extension%22
sevntu-checkstyle-maven-plugin:!https://maven-badges.herokuapp.com/maven-central/com.github.sevntu-checkstyle/sevntu-checkstyle-maven-plugin/badge.svg!:https://search.maven.org/#search|gav|1|g%3A%22com.github.sevntu-checkstyle%22%20AND%20a%3A%22sevntu-checkstyle-maven-plugin%22
sevntu-checkstyle-sonar-plugin:!https://maven-badges.herokuapp.com/maven-central/com.github.sevntu-checkstyle/sevntu-checkstyle-sonar-plugin/badge.svg!:https://search.maven.org/#search|gav|1|g%3A%22com.github.sevntu-checkstyle%22%20AND%20a%3A%22sevntu-checkstyle-sonar-plugin%22
eclipsecs-sevntu-plugin: "all versions":https://github.com/sevntu-checkstyle/sevntu.checkstyle/tree/gh-pages/update-site/plugins

All sevntu artifact on maven repo: https://repo1.maven.org/maven2/com/github/sevntu-checkstyle/


Additional(non-standard) checks for Checkstyle that are compiled as:
- extension to "maven-checkstyle-plugin":http://maven.apache.org/plugins/maven-checkstyle-plugin/ (how to use: "in general":http://maven.apache.org/plugins/maven-checkstyle-plugin/examples/custom-developed-checkstyle.html, "maven, ant, gradle example":https://github.com/sevntu-checkstyle/checkstyle-samples).
- extension to "Sonar Checkstyle Plugin":http://docs.codehaus.org/display/SONAR/Checkstyle+Plugin (how to use: "instructions with pictures":https://github.com/sevntu-checkstyle/sevntu.checkstyle/wiki/How-to-integrate-sevntu-checks-into-SonarQubeTM-%28user%27s-guide%29).
- extension to "CheckStyle-IDEA":http://plugins.jetbrains.com/plugin/1065 (how to use: "instructions with pictures":https://github.com/sevntu-checkstyle/sevntu.checkstyle/wiki/How-to-use-SevNTU-Checkstyle-in-Intellij-IDEA).
- extension to "Checkstyle Beans, NetBeans":http://plugins.netbeans.org/plugin/3413/checkstyle-beans (how to use: "instructions with pictures":https://github.com/sevntu-checkstyle/sevntu.checkstyle/wiki/How-to-use-SevNTU-Checkstyle-in-NetBeans).
- extension to "Checkstyle Eclipse plugin":http://eclipse-cs.sourceforge.net/ how to use: install from EclipseCS "update site":
- extension to "Checkstyle Eclipse plugin":http://eclipse-cs.sourceforge.net/ how to use: install from EclipseCS "update site":
!https://cloud.githubusercontent.com/assets/812984/2935361/20e479c8-d805-11e3-9391-f41cc4aa979c.png!

h3. Related Projects
Expand All @@ -14,7 +23,7 @@ h3. Related Projects

h3. Contributors

"Roman Ivanov":https://github.com/romani, "Ivan Sopov":https://github.com/isopov, "Ruslan Diachenko":https://github.com/rdiachenko, Danil Lopatin, "Daniil Yaroslavtsev":https://github.com/daniilyar, "Yuriy Balahonov":https://github.com/balakhonov, Dmitriy Antonenko,
"Roman Ivanov":https://github.com/romani, "Ivan Sopov":https://github.com/isopov, "Ruslan Diachenko":https://github.com/rdiachenko, Danil Lopatin, "Daniil Yaroslavtsev":https://github.com/daniilyar, "Yuriy Balakhonov":https://github.com/balakhonov, Dmitriy Antonenko,
Hidoyatov Victor, Troshin Sergey, Svinukhov Vladimir, "Ilia Dubinin":https://github.com/sabaka, Dmitry Gridyushko, "Vadym Chekrii":https://github.com/vchekrii, "Vadim Panasiuk":https://github.com/VadimPanasiuk,
"Aleksey Grigirov":https://github.com/KTannenberg, Alexander Berezovsky, "Sergey Burtsev":https://github.com/burtsevsergey, "Baratali Izmailov":https://github.com/baratali, "Max Vetrenko":https://github.com/maxvetrenko,
"Pavel Baranchikov":https://github.com/pbaranchikov , "Ashutosh Agarwal":https://github.com/Radsaggi, "Alexey Nesterenko":https://github.com/alexkravin. , ...... for whole list please look at "contributors list":https://github.com/sevntu-checkstyle/sevntu.checkstyle/network/members .
6 changes: 4 additions & 2 deletions deploy-all.sh
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
#!/bin/sh
sh deploy.sh --all
#!/usr/bin/env bash

CURRENT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
$CURRENT_DIR/deploy.sh --all
Loading

0 comments on commit 0b25a9b

Please sign in to comment.