Skip to content

Commit 9c26429

Browse files
authored
Add guidelines for deprecating tools. Deprecate jshint and jslint (#224)
1 parent 0be3f35 commit 9c26429

File tree

5 files changed

+105
-101
lines changed

5 files changed

+105
-101
lines changed

CONTRIBUTING.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# How to add a new tool to the list
2+
13
Please feel free to open a pull request if you know of a code analysis tool that is not mentioned here.
24
If you're in doubt if a tool is a good fit for the list, **don't open an issue, but create a pull request right away** because that's easier to handle. Thanks! :smiley:
35

@@ -41,4 +43,23 @@ If you can, please limit yourself to only one category.
4143
This way, all tools get treated fairly and the list is easier to read.
4244

4345

46+
# How to mark a tool as unmaintained/deprecated
47+
48+
Sometimes it happens that a tool becomes unmaintained and there's nothing wrong
49+
with that.
50+
After all, a tool can still be very valuable to the community - even without
51+
frequent updates.
52+
However, since it is one of the goals of this project to allow people to make an
53+
informed decision on what is the best tool for the job, we are marking
54+
unmaintained or deprecated tools with a :warning: (`:warning:`) sign.
55+
This sign indicates that the community does not recommend to use this tool for
56+
new projects anymore.
57+
58+
[Here](https://github.com/mre/awesome-static-analysis/issues/223) is a nice
59+
discussion about why we think this is necessary. If you find a tool, which is
60+
unmaintained, please create a pull request which adds the `:warning:` sign and
61+
provide an objective explanation as to why you think the tool should be marked.
62+
Every deprecation will be handled on a case-by-case basis.
63+
64+
4465
**Thanks for helping out!** :tada:

README.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,11 @@
33
> Static program analysis is the analysis of computer software that is performed without actually executing programs — [Wikipedia](https://en.wikipedia.org/wiki/Static_program_analysis)
44
55
This is a collection of static analysis tools and code quality checkers. Pull requests are very welcome!
6-
**Note: :copyright: stands for proprietary software. All other tools are Open Source.**
6+
7+
* :copyright: stands for proprietary software. All other tools are Open Source.
8+
* :warning: indicates that the community does not recommend to use this tool for
9+
new projects anymore as it is outdated or no longer maintained.
10+
711
Also check out the sister project, [awesome-dynamic-analysis](https://github.com/mre/awesome-dynamic-analysis).
812

913
# Table of Contents
@@ -251,8 +255,8 @@ Also check out the sister project, [awesome-dynamic-analysis](https://github.com
251255
* [eslint](https://github.com/eslint/eslint) - A fully pluggable tool for identifying and reporting on patterns in JavaScript
252256
* [Esprima](https://github.com/jquery/esprima) - ECMAScript parsing infrastructure for multipurpose analysis
253257
* [flow](https://flow.org/) - A static type checker for JavaScript.
254-
* [jshint](https://github.com/jshint/jshint) - detect errors and potential problems in JavaScript code and enforce your team's coding conventions
255-
* [JSLint](https://github.com/douglascrockford/JSLint) :copyright: - The JavaScript Code Quality Tool
258+
* [jshint](https://github.com/jshint/jshint) :warning: - detect errors and potential problems in JavaScript code and enforce your team's coding conventions
259+
* [JSLint](https://github.com/douglascrockford/JSLint) :warning: - The JavaScript Code Quality Tool
256260
* [JSPrime](https://github.com/dpnishant/jsprime) - static security analysis tool
257261
* [NodeJSScan](https://github.com/ajinabraham/NodeJsScan) - NodeJsScan is a static security code scanner for Node.js applications.
258262
* [plato](https://github.com/es-analysis/plato) - Visualize JavaScript source complexity

ci/Cargo.lock

Lines changed: 63 additions & 78 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ci/Cargo.toml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
[package]
22
authors = ["Matthias Endler <[email protected]>"]
33
name = "ci"
4-
version = "0.2.0"
4+
version = "0.3.0"
5+
edition = "2018"
56

67
[dependencies]
7-
lazy_static = "0.2.9"
8-
regex = "0.2.2"
9-
failure = "0.1.1"
8+
lazy_static = "1.2.0"
9+
regex = "1.1.0"
10+
failure = "0.1.5"

ci/src/lib.rs

Lines changed: 9 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,17 @@
11
// `error_chain!` can recurse deeply
22
#![recursion_limit = "1024"]
33

4-
#[macro_use]
5-
extern crate failure;
6-
7-
#[macro_use]
8-
extern crate lazy_static;
9-
10-
extern crate regex;
11-
12-
use failure::{Error, err_msg};
4+
use lazy_static::lazy_static;
5+
use failure::{Error, err_msg, bail};
136
use regex::Regex;
14-
use std::fmt;
157
use std::cmp::Ordering;
168

179
lazy_static! {
18-
static ref TOOL_REGEX: Regex = Regex::new(r"\*\s\[(?P<name>.*)\]\((?P<link>http[s]?://.*)\)\s(:copyright:\s)?\-\s(?P<desc>.*)").unwrap();
10+
static ref TOOL_REGEX: Regex = Regex::new(r"\*\s\[(?P<name>.*)\]\((?P<link>http[s]?://.*)\)\s(:warning:\s)?(:copyright:\s)?\-\s(?P<desc>.*)").unwrap();
1911
static ref SUBSECTION_HEADLINE_REGEX: Regex = Regex::new(r"[A-Za-z\s]*").unwrap();
2012
}
2113

22-
struct Tool {
14+
pub struct Tool {
2315
name: String,
2416
link: String,
2517
desc: String,
@@ -55,7 +47,7 @@ impl Ord for Tool {
5547
}
5648
}
5749

58-
fn check_tool(tool: &str) -> Result<Tool, Error> {
50+
pub fn check_tool(tool: &str) -> Result<Tool, Error> {
5951
println!("Checking `{}`", tool);
6052
// NoneError can not implement Fail at this time. That's why we use ok_or
6153
// See https://github.com/rust-lang-nursery/failure/issues/61
@@ -79,7 +71,7 @@ fn check_tool(tool: &str) -> Result<Tool, Error> {
7971
Ok(Tool::new(name, link, desc))
8072
}
8173

82-
fn check_section(section: String) -> Result<(), Error> {
74+
pub fn check_section(section: String) -> Result<(), Error> {
8375
// Ignore license section
8476
if section.starts_with("License") {
8577
return Ok(());
@@ -108,14 +100,14 @@ fn check_section(section: String) -> Result<(), Error> {
108100
check_ordering(tools)
109101
}
110102

111-
fn check_ordering(tools: Vec<Tool>) -> Result<(), Error> {
103+
pub fn check_ordering(tools: Vec<Tool>) -> Result<(), Error> {
112104
match tools.windows(2).find(|t| t[0] > t[1]) {
113105
Some(tools) => bail!("`{}` does not conform to alphabetical ordering", tools[0].name),
114106
None => Ok(()),
115107
}
116108
}
117109

118-
fn check(text: String) -> Result<(), Error> {
110+
pub fn check(text: String) -> Result<(), Error> {
119111
let sections = text.split("\n# ");
120112

121113
// Skip first two sections,
@@ -129,6 +121,7 @@ fn check(text: String) -> Result<(), Error> {
129121
Ok(())
130122
}
131123

124+
#[cfg(test)]
132125
mod tests {
133126
use super::*;
134127
use std::fs::File;

0 commit comments

Comments
 (0)