Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
Conflicts:
	README.md
  • Loading branch information
ryaneberly committed Jul 29, 2017
2 parents cc4d7a1 + d738ef4 commit dd9cc30
Show file tree
Hide file tree
Showing 122 changed files with 2,761 additions and 1,883 deletions.
23 changes: 23 additions & 0 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
![CFLint](/src/main/resources/CFLint-logo.jpg)

Code of Conduct
===============

###TL;DR
Don't be a dick!

### What we stand for

CFLint is a project developed and worked on by volunteers. Please be nice and considerate, we're here to help. We really appreciate fixes and improvements, feel free to talk to us and/or provide pull requests.

This is a place where considerate positive people, who enjoy fun and care about their craft and its impact, come together to code, learn, talk, hang out and build a product for the greater good of the CFML community.

We're inclusive and harassment-free based on treating everyone with respect and kindness, regardless of gender, sexual orientation, age, physical ability or appearance, ethnicity or religious beliefs.

We try to do everything we can to ensure that only the good stuff happens. If somebody violates that, or makes you feel uncomfortable or unsafe in any way, please let us know. We’ll take it seriously and their behaviour will be dealt with as deemed necessary. They’ll certainly be asked to stop the inappropriate behaviour and will be expected to comply immediately. It may also include ejection from the project.

We respect all participants, and assume everyone joins in good faith. We won’t attempt to list all the behaviours that are unacceptable and inappropriate when you are interacting with your peers, in case we inadvertently exclude the one very thing leads to an incident. To quote the folks from the Kiwicon conference, the “inventive genius of random assholes” is limitless. It surely goes without saying however, that offensive comments, intimidation, stalking, sustained disruption of discussions and unwelcome sexual attention are totally inappropriate.

If you have any concerns whatsoever, about the comfort and safety of yourself or someone else, please contact [Ryan](https://github.com/ryaneberly) or [Kai](https://github.com/TheRealAgentK) at any time.


20 changes: 20 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
![CFLint](/src/main/resources/CFLint-logo.jpg)

Contributing to CFLint
======================

# Project and library organisation

CFLint is a project developed and worked on by volunteers. When logging issues please be nice and considerate, we're here to help. We really appreciate fixes and improvements, feel free to talk to us and/or provide pull requests.

/src/main contains the source code. Tests can be found in /src/test. CFLint relies heavily on the [CFParser](https://github.com/cfparser/cfparser) project as well as a bunch of 3rd party Java libraries.

The master branch is considered our stable codebase. Most of the development happens in the dev branch resp. local development branches for specific issues.

# How to contribute?

The main repository of this project is https://github.com/cflint/CFLint.

Please fork from there, create a local dev branch from origin/dev (named so that it explains the work in the branch), and submit a pull request against the main repository's dev branch. Even better, get in touch with us here on Github before you undertake any work so that it can be coordinated with what we're doing.

If you're interested in contributing on a regular basis, get in touch with [Ryan](https://github.com/ryaneberly) and we can add you to the internal CFLint Slack team.
138 changes: 120 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -181,18 +181,135 @@ The configuration rule that is closest to the rule is the one that takes effect.

## Creating reports

More to come on this and the subsections from Kai
CFLint supports a variety of output options that you can control via command-line flags. If youy want more information about the inner workings of CFLint during execution you can run CFLint in verbose mode by supplying -verbose or -v at the command line.

### XML

The flag -xml instructs CFLint to create XML. There are two options for XML reporting.

The first option is what we call CFlint XML. It's an internal format that adheres to a basic schema. You could then use this format as-is or to do further processing of your choice.

The seconds option is Findbugs XML. The resulting XML document adheres to the current version of the Findbugs Bugcollection XML Schema Definition (src/main/resources/findbugs/bugcollection.xsd) and can be used in most CI-/Build-Server products. Jetbrains Team City 10+ can import this format out of the box.

Please note: Currently it's not possible to produce BOTH flavours of XML reports at the same time. This is a known limitation. If you feel this hinders your use of CFLint, please raise an issue.

#### CFLint XML

To create CFLint XML provide the following command-line arguments:

-xml -xmlstyle cflint -xmlfile <outputFileName>

Example of CFLint XML:

<?xml version="1.0" encoding="UTF-8" ?>
<issues version="1.2.0" timestamp="1500107134">
<issue severity="WARNING" id="CFQUERYPARAM_REQ" message="CFQUERYPARAM_REQ" category="CFLint" abbrev="CR">
<location file="/Users/kai/Documents/Code/paypal.cfc" fileName="paypal.cfc" function="doSomething" column="0" line="325" message="&lt;cfquery&gt; should use &lt;cfqueryparam/&gt; for variable 'arguments.PaymentType'." variable="arguments.PaymentType">
<Expression><![CDATA[<cfquery name="doPayment" datasource="#paymentDatasource#">...some more Details...]]></Expression>
</location>
</issue>
<issue severity="WARNING" id="CFQUERYPARAM_REQ" message="CFQUERYPARAM_REQ" category="CFLint" abbrev="CR">
<location file="/Users/kai/Documents/Code/paypal.cfc" fileName="paypal.cfc" function="doSomethingElse" column="0" line="432" message="&lt;cfquery&gt; should use &lt;cfqueryparam/&gt; for variable 'arguments.something'." variable="arguments.something">
<Expression><![CDATA[<cfquery name="doPayment" datasource="#paymentDatasource#">...some more Details...]]></Expression>
</location>
</issue>
...
<counts totallines="108" totalsize="55596">
<count code="CFQUERYPARAM_REQ" count="39"></count>
<count severity="WARNING" count="39"></count>
</counts>
</issues>

#### Findbugs XML

To create Findbugs XML provide the following command-line arguments:

-xml -xmlstyle findbugs -xmlfile <outputFileName>

The Findbugs XML format is currently created using an XSLT document, transforming the CFLint report to Findbugs XML (src/main/resources/findbugs/cflint-to-findbugs.xsl).

### JSON

JSON output can be created with

-json -jsonfile <outputFileName>

Example of CFLint JSON:

{
"version" : "",
"timestamp" : "1501202128",
"issues" : [ {
"severity" : "ERROR",
"id" : "MISSING_VAR",
"message" : "MISSING_VAR",
"category" : "CFLINT",
"abbrev" : "MV",
"locations" : [ {
"file" : "src/test/resources/com/cflint/tests/Ignores/ignoreCFMLAny2.cfc",
"fileName" : "ignoreCFMLAny2.cfc",
"function" : "testFunction",
"column" : 6,
"line" : 14,
"message" : "Variable someVar is not declared with a var statement.",
"variable" : "someVar",
"expression" : "someVar"
} ]
} ],
"counts" : {
"totalFiles" : 7,
"totalLines" : 49,
"countByCode" : [ {
"code" : "MISSING_VAR",
"count" : 1
} ],
"countBySeverity" : [ {
"severity" : "ERROR",
"count" : 1
} ]
}
}

### Text

Plain text output can be created with

-text -textfile <outputFileName>

Example of plain text output:

Issue
Severity:WARNING
Message code:CFQUERYPARAM_REQ
File:/Users/kai/Documents/Code/paypal.cfc
Column:0
Line:79
Message:<cfquery> should use <cfqueryparam/> for variable 'arguments.something'.
Variable:'arguments.something' in function:
Expression:<cfquery name=\"qry\" datasource=\"#variables.dsn#\" cachedwithin=\"#createTimeSpan(0,0,arguments.cacheInMins,0)#\">\r\n...some Details...
Severity:WARNING
Message code:CFQUERYPARAM_REQ
File:/Users/kai/Documents/Code/paypal.cfc
Column:0
Line:145
Message:<cfquery> should use <cfqueryparam/> for variable 'arguments.something'.
Variable:'arguments.something' in function:
Expression:<cfquery name=\"qry\" datasource=\"#variables.dsn#\" cachedwithin=\"#createTimeSpan(0,0,arguments.cacheInMins,0)#\">\r\n...some Details...
...

Total files:108
Total lines:55690

Issue counts:1
CFQUERYPARAM_REQ:4

Total issues:4
Total warnings:4



## Integration server support

Expand Down Expand Up @@ -346,16 +463,12 @@ The [CFML Slack team](http://cfml-slack.herokuapp.com/) has a #cflint channel yo

# How to contribute?

The main repository of this project is https://github.com/cflint/CFLint.

Please fork from there, create a local dev branch from origin/dev (named so that it explains the work in the branch), and submit a pull request against the main repository's dev branch. Even better, get in touch with us here on Github before you undertake any work so that it can be coordinated with what we're doing.

If you're interested in contributing on a regular basis, get in touch with [Ryan](https://github.com/ryaneberly) and we can add you to the internal CFLint Slack team.
See CONTRIBUTING.md for further information


# Interesting 3rd-party projects

Please note that the majority of the libraries and projects mentioned here are not directly related and maintainedby the CFLint team. Please see the authors and maintainers of those projects for support using their libraries first.
Please note that the majority of the libraries and projects mentioned here are not directly related to and maintained by the CFLint team. Please see the authors and maintainers of the respective project for support using their libraries first.

- [Jenkins/Hudson plugin](https://github.com/jenkinsci/CFLint-plugin) for CFLint
- [SublimeLinter plugin](https://github.com/ckaznocha/SublimeLinter-contrib-CFLint) for CFlint
Expand All @@ -367,17 +480,6 @@ Please note that the majority of the libraries and projects mentioned here are n














---TO DO START

Get rid of / refactor content...
Expand Down
25 changes: 25 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -75,3 +75,28 @@ test {
showStandardStreams = true
}
}

jar {
manifest {
attributes(
'Main-Class': 'com.cflint.main.CFLintMain',
)
}
}

task fatJar(type: Jar) {
manifest.from jar.manifest
classifier = 'all'
from {
configurations.runtime.collect { it.isDirectory() ? it : zipTree(it) }
} {
exclude "META-INF/*.SF"
exclude "META-INF/*.DSA"
exclude "META-INF/*.RSA"
}
with jar
}

artifacts {
archives fatJar
}
7 changes: 5 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>com.github.cflint</groupId>
<artifactId>CFLint</artifactId>
<version>1.2.0-SNAPSHOT</version>
<version>1.2.0</version>
<packaging>jar</packaging>

<name>CFLint</name>
Expand Down Expand Up @@ -64,7 +64,7 @@
<maven.compiler.source>1.7</maven.compiler.source>
<maven.compiler.target>1.7</maven.compiler.target>

<cfparser.version>2.4.9</cfparser.version>
<cfparser.version>2.4.10</cfparser.version>
<jackson.version>2.8.6</jackson.version>
<slf4j.version>1.7.21</slf4j.version>
</properties>
Expand Down Expand Up @@ -256,7 +256,10 @@
<configuration>
<dateFormat>yyyyMMdd-HHmmss</dateFormat>
<dotGitDirectory>${project.basedir}/.git</dotGitDirectory>
<generateGitPropertiesFilename>${project.build.outputDirectory}/git.properties</generateGitPropertiesFilename>
<generateGitPropertiesFile>true</generateGitPropertiesFile>
<failOnNoGitDirectory>false</failOnNoGitDirectory>
<failOnUnableToExtractRepoInfo>false</failOnUnableToExtractRepoInfo>
</configuration>
</plugin>
<plugin>
Expand Down
Loading

0 comments on commit dd9cc30

Please sign in to comment.