Skip to content

Commit

Permalink
Dev prep 1.2.1 release (#415)
Browse files Browse the repository at this point in the history
* Remove dependency copying (#376)

There doesn't seem to be a reason to have this phase. Perhaps there was
one before? All the required dependencies are added to the final JAR by
the `maven-shade-plugin` in the `package` phase anyway. This dependency
copying just seems like a waste of time.

* Add .editorconfig

Provides common whitespace settings for all editors. Supported out of
the box in some IDE's (like IntelliJ IDEA) and all others have
appropriate plugins.

*  Added .cflintrc schema and output schemas for JSON and XML. Tweaked README. (#377)

Added .cflintrc schema and output schemas for JSON and XML. Tweaked README.

* support autochange

* #382

* Align Gradle dependencies with Maven ones (#378)

Define the same set (and scopes) of dependencies for Gradle builds as we
have now in Maven's `pom.xml`.

* Added some context to the changelog for 1.2.0 and removed a lot of "##### no issues" items that were added to the list.

* Changed setting for auto-adding a final new line, that screws up expected files for tests.

* #383 Changed code, test, README with the output sample and JSON schema.

* Update timestamp type in result schemas

* #385 Two small modifications to HTML report

* Changed build versions to 1.2.1-SNAPSHOT in dev branch and change documentation to 1.2.1 in dev branch.

* 390 Add Implementation-Version to MANIFEST

Configures the Maven and Gradle builds to include
`Implementation-Version` in the MANIFEST.MF file, which can then be read
by the application and displayed to the user.

* #385 - Further HTML report improvements

* #390 - Adapting new way to grab version string

* #390 - Hopefully fixing Gradle build

* #390 - Review changes

* #396 fixed

* Update README.md

Explains how to pass multiple arguments in the command line in Windows Powershell and fixes a typo.

Fixes #400

* Update CODE_OF_CONDUCT.md

* #380 fixed

* Added VS Code info. Some cleanup.

* use cfparser 2.4.11

* #408

* #373

* #367

* #367

* add sonatype repo

* merged master

* cfparser 2.5.0

* Added test for #359 showing parsing error gone with cfparser 2.5.0

* #359 use parseCFMLExpression

* fix tests

* test for #346

* #413

* fix test

* fix javadoc
  • Loading branch information
ryaneberly authored Aug 10, 2017
1 parent 755f490 commit fd33665
Show file tree
Hide file tree
Showing 154 changed files with 1,246 additions and 867 deletions.
7 changes: 7 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
root = true

[*]
charset = utf-8
insert_final_newline = false
indent_style = space
indent_size = 4
30 changes: 20 additions & 10 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,26 @@
History

=======

## Overview of major changes in CFLint 1.2.0

### Parsing

* Numerous fixes for parsing CFML code, update to CFParser 2.4.10
* Upgrade to ANTLR 4.7

### Linting

* Bugfixes for rule processing
* Added annotation-based ignoring of rules inline in code.
* JSON-based configuration has undergone a few changes and configuration properties have been deprecated.

### Output

* Support for -showStats has been removed - scanning statistics are now always produced and displayed/included
* Findbugs XML output now matches the requirements for Findbugs' bugcollection.xsd and has undergone major changes from earlier versions.
* CFLint XML output has some additional attributes for some XML elements in the output structure (no breaking changes)
* JSON output has undergone a rework of the existing data structure to cater for the output of additional information (breaking changes)


## CFLint1.2.0
##### GitHub [#152](https://github.com/cflint/CFLint/issues/152) UNUSED_METHOD_ARGUMENT ignores scoped arguments
Expand Down Expand Up @@ -73,7 +92,6 @@ History
##### GitHub [#363](https://github.com/cflint/CFLint/issues/363) Maven build fails using the ZIP file from GitHub since it needs the `.git` folder
##### GitHub [#366](https://github.com/cflint/CFLint/issues/366) ANTLR Tool version 4.6 mismatch
##### GitHub [#370](https://github.com/cflint/CFLint/pull/370) #323 - Changing JSON structure and changing expected test results
##### No issue
## CFLint-1.0.1
##### GitHub [#103](https://github.com/cflint/CFLint/issues/103) Enhancement: Enable default config file when parsing similar to other linters
##### GitHub [#114](https://github.com/cflint/CFLint/issues/114) Group and decide which linting rules to include by default.
Expand All @@ -96,24 +114,20 @@ History
##### GitHub [#247](https://github.com/cflint/CFLint/pull/247) Update SureFire argLine
##### GitHub [#248](https://github.com/cflint/CFLint/issues/248) Component name missing from message for COMPONENT_INVALID_NAME
##### GitHub [#250](https://github.com/cflint/CFLint/issues/250) Analysis tripped up over UTF-8 files with BOM
##### No issue
## CFLint-0.6.1
##### No issue
## v0.6.0
##### GitHub [#104](https://github.com/cflint/CFLint/issues/104) Weird messaging for missing semicolon
##### GitHub [#105](https://github.com/cflint/CFLint/issues/105) Warnings for non-existing errors and non-lint errors before output.
##### GitHub [#62](https://github.com/cflint/CFLint/issues/62) JSON output
##### GitHub [#67](https://github.com/cflint/CFLint/issues/67) Gradle Install
##### GitHub [#80](https://github.com/cflint/CFLint/issues/80) Gradle Deployment
##### GitHub [#95](https://github.com/cflint/CFLint/issues/95) support json config instead of xml
##### No issue
## CFLint0.5.1
##### GitHub [#65](https://github.com/cflint/CFLint/issues/65) Problem with dynamic table and field names
##### GitHub [#66](https://github.com/cflint/CFLint/issues/66) cflint-disable / cflint-enable ?
##### GitHub [#71](https://github.com/cflint/CFLint/issues/71) Unable to exclude rules
##### GitHub [#89](https://github.com/cflint/CFLint/pull/89) Rule to check for writeDump in cfset tags and script blocks
##### GitHub [#97](https://github.com/cflint/CFLint/issues/97) Release 0.5.1-SNAPSHOT
##### No issue
## v0.5
##### GitHub [#33](https://github.com/cflint/CFLint/issues/33) no cflint version could be extracted with SublimeLinter
##### GitHub [#35](https://github.com/cflint/CFLint/issues/35) CFLint Should Download Latest Version of CFParser
Expand All @@ -129,7 +143,6 @@ History
##### GitHub [#60](https://github.com/cflint/CFLint/issues/60) Having trouble using filterFile
##### GitHub [#62](https://github.com/cflint/CFLint/issues/62) JSON output
##### GitHub [#63](https://github.com/cflint/CFLint/issues/63) Release v0.5.0
##### No issue
## CFLint-0.4-release
##### GitHub [#19](https://github.com/cflint/CFLint/issues/19) Convert bugs.add() to a plugin format.
##### GitHub [#21](https://github.com/cflint/CFLint/issues/21) <cfset/> on multiple lines does not process
Expand All @@ -139,7 +152,6 @@ History
##### GitHub [#27](https://github.com/cflint/CFLint/issues/27) Maven build fails with error.
##### GitHub [#30](https://github.com/cflint/CFLint/issues/30) NESTED_CFOUTPUT false positive
##### GitHub [#31](https://github.com/cflint/CFLint/issues/31) Trying out the configfile from the command line and getting errors
##### No issue
## CFLint-0.4
##### No issue
## CFLint-0.3.0
Expand All @@ -151,12 +163,10 @@ History
##### GitHub [#6](https://github.com/cflint/CFLint/issues/6) Add -version flag
##### GitHub [#7](https://github.com/cflint/CFLint/issues/7) Add severity level to each issue in stdout
##### GitHub [#8](https://github.com/cflint/CFLint/issues/8) does not support tagless components
##### No issue
## CFLint-0.1.8
##### No issue
## CFLint-0.1.6
##### GitHub [#1](https://github.com/cflint/CFLint/issues/1) ignore .cfm~ files
##### No issue
## CFLint-0.1.5
##### No issue
## CFLint-0.1.4
Expand Down
2 changes: 1 addition & 1 deletion CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
Code of Conduct
===============

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

### What we stand for
Expand Down
84 changes: 36 additions & 48 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ A static code analysis tool for CFML.

License: [BSD](http://www.opensource.org/licenses/bsd-license.html)

Current Version: 1.2.0 (Jul 29 2017)
Current Version: 1.2.1 (Aug xx 2017)

# Versions

Expand Down Expand Up @@ -49,7 +49,7 @@ If you want to use CFLint from within another Maven project, use:
<dependency>
<groupId>com.github.cflint</groupId>
<artifactId>CFLint</artifactId>
<version>1.2.0</version>
<version>1.2.1</version>
</dependency>

Or always use the latest:
Expand All @@ -64,19 +64,19 @@ With the binaries retrieved one or the other way, you can now use CFLint on the

#### Use the "-all"-version of the jar-file:

CFLint-1.2.0-all.jar
CFLint-1.2.1-all.jar

#### Scan a folder with the complete set of rules:

java -jar CFLint-1.2.0-all.jar -folder <baseFolder>
java -jar CFLint-1.2.1-all.jar -folder <baseFolder>

#### Scan a folder with the complete set of rules:

java -jar CFLint-1.2.0-all.jar -file <fullPathToFile>
java -jar CFLint-1.2.1-all.jar -file <fullPathToFile>

#### See parameters and help:

java -jar CFLint-1.2.0-all.jar -help
java -jar CFLint-1.2.1-all.jar -help

# User manual

Expand Down Expand Up @@ -127,13 +127,13 @@ An example `.cflintrc` file is shown below:

* Please note: `inheritPlugins` and `output` have been marked deprecated in CFLint 1.2.0 and will be removed in 1.3.0. If you are using `.cflintrc` files now, please remove the inheritPlugins and output properties as soon as possible. Plugin inheritance will going forward always be treated as true, the team can not see a use case in which it should be disabled. The value of the output attribute is ignored.

You can find a schema with the deprecated properties excluded [here](/src/main/resources/schemas/.cflintrc.schema.json).
We provide a [schema with the deprecated properties excluded](/src/main/resources/schemas/.cflintrc.schema.json).

### Annotation-based configuration

Quite often there are scenarios in which you would generally want to run a certain set of rules against your code but in specific cases need to ignore an otherwise valid violation.

A common example are violations of CFQUERYPARAM_REQ that can't be fixed by applying `<CFQUERYPARAM...>` because your DB server doesn't allow `<CFQUERPARAM>` in a certain position (for instance in a `SELECT TOP #arguments.numberOfRecords# ...` scenario). See [Issue #282](https://github.com/cflint/CFLint/issues/282) for more examples.
A common example are violations of CFQUERYPARAM_REQ that can't be fixed by applying `<cfqueryparam>` because your DB server doesn't allow params in certain positions (for instance in a `SELECT something FROM #application.config.linkedServerName#.DefaultDatabase.dbo.Comment` scenario). See [Issue #282](https://github.com/cflint/CFLint/issues/282) for more examples.

CFLint offers an annotation-based configuration to deal with this and similar scenarios. Annotations can be placed on the component- or function-level in a CFC or inline with code.

Expand All @@ -158,6 +158,7 @@ Multiline ignore annotation:
/*
@CFLintIgnore SOMETHINGELSE,MISSING_VAR,ANOTHERTHINGTOIGNORE
*/

#### Ignoring within SQL:

Within SQL, you can also use
Expand All @@ -166,20 +167,21 @@ Within SQL, you can also use

to ignore a rule violation on the next line.

### Precendence of configuration settings
### Precedence of configuration settings

Configuration of which plugins are run and which rules are included starts with the global configuration and flows through the command line parameters, folder level rules, and down to the annotations within the source.

* global configuration
* custom configuration file (--configfile)
* rule groups (--rulegroups, default behaviour is --rulegroups !Experimental)
* includes/excludes from the command line (--includeRule and --excludeRule)
* custom configuration file (`-configfile`)
* rule groups (`-rulegroups`, default behaviour is --rulegroups !Experimental)
* includes/excludes from the command line (`-includeRule` and `-excludeRule`)
* .cflintrc - folder level configuration, mostly for including/excluding specific messages
* annotations - explicitly exclude messages in the source code at the tag or line level.

The configuration rule that is closest to the rule is the one that takes effect.
* If an annotation excludes a message, it will not fire regardless of any configuration above it.
* If you exclude a rule at the command line level, but a .cflintrc adds it back in, it will fire for source files in that part of the source tree.
* If you exclude a rule at the command line level, but a `.cflintrc` adds it back in, it will fire for source files in that part of the source tree.
* If you are passing in multiple parameters at the command line level, in Windows Powershell the parameters must be included in "double quotes", e.g. `-includeRule "MISSING_VAR,CFQUERYPARAM_REQ"`

## Creating reports

Expand All @@ -189,7 +191,7 @@ CFLint supports a variety of output options that you can control via command-lin

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 found [here](/src/main/resources/schemas/cflint-result.xsd). You could then use this format as-is or to do further processing of your choice.
The first option is what we call CFLint XML. It's an internal format that adheres to a basic schema provided [here](/src/main/resources/schemas/cflint-result.xsd). 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 TeamCity 10+ can import this format out of the box.

Expand All @@ -204,7 +206,7 @@ To create CFLint XML provide the following command-line arguments:
Example of CFLint XML:

<?xml version="1.0" encoding="UTF-8" ?>
<issues version="1.2.0" timestamp="1500107134">
<issues version="1.2.1" 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>
Expand Down Expand Up @@ -239,8 +241,8 @@ JSON output can be created with
Example of CFLint JSON:

{
"version" : "1.2.0",
"timestamp" : "1501202128",
"version" : "1.2.1",
"timestamp" : 1501202128,
"issues" : [ {
"severity" : "ERROR",
"id" : "MISSING_VAR",
Expand Down Expand Up @@ -317,27 +319,29 @@ Example of plain text output:

## Integration server support

For Jenkins, please look at the Jenkins/Hudson plugin mentioned further below.
For **Jenkins**, please look at the Jenkins/Hudson plugin mentioned further below.

JetBrains' TeamCity has support for FindBugs XML code inspection reports. They can be produced out of the box with CFLint from 1.2.0 onwards (see above in the [FindBugs XML section](#findbugs-xml)).
JetBrains' **TeamCity** has support for FindBugs XML code inspection reports. They can be produced out of the box with CFLint from 1.2.0 onwards (see above in the [FindBugs XML section](#findbugs-xml)).

There is support for SonarQube through StepStone's Sonar ColdFusion plugin mentioned further below.
There is support for **SonarQube** through StepStone's Sonar ColdFusion plugin mentioned further below.

There's an NPM wrapper for CFLint below. Please be aware that the wrapper seems to come with its own bundled CFLint binary which might not be up-to-date, which is outside of our control.

Other products in the integration/build server category might work, too. If you're using a specific product that works for you with CFLint please let us know. If you can't get CFLint to work in an environment you use, please let us know as well - we might be able to help.
Other products in the integration/build server category might work, too. If you're using a specific product that works for you with CFLint, please let us know. If you can't get CFLint to work in an environment you use, please let us know as well - we might be able to help.

## IDE support

Currently there is IDE support for Sublime Text through a third-party project (see below).
There are several IDE integrations for CFLint that are available. Below are some brief descriptions, but if you'd like to know more, see [Interesting third-party projects](#interesting-third-party-projects).

There is IDE support for **Sublime Text 3** through a third-party project utilizing SublimeLinter.

There is also support for Adobe's ColdFusion Builder through a third-party project (see below). Users of CFBuilder, please also see the discussion in issue [#327](https://github.com/cflint/CFLint/issues/327).
There is also support for **Adobe ColdFusion Builder** through a third-party project. Users of CFBuilder, please also see the discussion in [Issue #327](https://github.com/cflint/CFLint/issues/327).

Users of Atom can integrate with AtomLinter through a third-party project (see below).
Users of **Atom** can integrate via AtomLinter through a third-party project.

Support for JetBrains' IntelliJ is planned; talk to [@TheRealAgentK](https://github.com/TheRealAgentK) for more info if you're interested.
An extension for **Visual Studio Code** is also available as a third-party project.

An extension for Visual Studio Code will be released in the near future.
Support for JetBrains' **IntelliJ** is planned; talk to [@TheRealAgentK](https://github.com/TheRealAgentK) for more info if you're interested.

## Extending CFLint

Expand Down Expand Up @@ -429,7 +433,7 @@ This can be simplified using the default values of a `.cflintrc` file:
"inheritParent" : false
}

See the discussion in [#290](https://github.com/cflint/CFLint/issues/290) for more info.
See the discussion in [Issue #290](https://github.com/cflint/CFLint/issues/290) for more info.


## Filtering out specific processing results in specific folders
Expand Down Expand Up @@ -477,27 +481,11 @@ See [CONTRIBUTING.md](/CONTRIBUTING.md) for further information.
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)
* [Sublime Text plugin](https://github.com/ckaznocha/SublimeLinter-contrib-CFLint)
* [ColdFusion Builder plugin](https://github.com/cfjedimaster/CFLint-Extension)
* [Atom plugin](https://github.com/ditinc/linter-cflint)
* [Sonar plugin](https://github.com/stepstone-tech/sonar-coldfusion)
* [Sublime Text package](https://github.com/ckaznocha/SublimeLinter-contrib-CFLint)
* [ColdFusion Builder extension](https://github.com/cfjedimaster/CFLint-Extension)
* [Atom package](https://github.com/ditinc/linter-cflint)
* [Visual Studio Code extension](https://github.com/ditinc/linter-cflint)
* [SonarQube plugin](https://github.com/stepstone-tech/sonar-coldfusion)
* [NPM wrapper](https://github.com/morgdenn/npm-cflint)
* Vim [Syntastic support for CFLint](https://github.com/cflint/cflint-syntastic)



---TO DO START

Get rid of / refactor content...

Check out the new [wiki!](https://github.com/cflint/CFLint/wiki) where you can:


* [Built in Rules](https://github.com/cflint/CFLint/wiki/Built-In-Rules)
* [Learn how to include/exclude rules](https://github.com/cflint/CFLint/wiki/Include-Exclude-Rules-Using-Exteral-XML-File)
* [Learn CFLint from the command line](https://github.com/cflint/CFLint/wiki/How-Do-I-Use-This-Tool%3F)
* [Get the library from Maven](https://github.com/cflint/CFLint/wiki/Get-the-library-from-Maven)
* [Ignore Specific Flags](https://github.com/cflint/CFLint/wiki/Ignoring-Specific-Flags-In-Code)


---TO DO END
Loading

0 comments on commit fd33665

Please sign in to comment.