From 84861afbc03aaa6efd64093b322d2dce4d7bc494 Mon Sep 17 00:00:00 2001 From: Daniel Giribet Date: Tue, 1 May 2012 22:10:39 +0200 Subject: [PATCH 1/4] First version of timestamp file skipping works --- .../maven/FileTimestampExcludeLister.java | 50 +++++++ .../jslint4java/maven/JSLintMojo.java | 91 ++++++++++-- .../jslint4java/maven/ReportWriterImpl.java | 1 + .../jslint4java/maven/TimestampFormatter.java | 39 +++++ .../maven/FileTimestampExcludeListerTest.java | 133 ++++++++++++++++++ .../jslint4java/maven/JSLintMojoTest.java | 53 ++++++- .../maven/MultiReportWriterTest.java | 6 +- .../maven/ReportWriterImplTest.java | 38 ++--- .../maven/TimestampFormatterTest.java | 75 ++++++++++ .../com/googlecode/jslint4java/maven/pom.xml | 1 + 10 files changed, 455 insertions(+), 32 deletions(-) create mode 100644 jslint4java-maven-plugin/src/main/java/com/googlecode/jslint4java/maven/FileTimestampExcludeLister.java create mode 100644 jslint4java-maven-plugin/src/main/java/com/googlecode/jslint4java/maven/TimestampFormatter.java create mode 100644 jslint4java-maven-plugin/src/test/java/com/googlecode/jslint4java/maven/FileTimestampExcludeListerTest.java create mode 100644 jslint4java-maven-plugin/src/test/java/com/googlecode/jslint4java/maven/TimestampFormatterTest.java diff --git a/jslint4java-maven-plugin/src/main/java/com/googlecode/jslint4java/maven/FileTimestampExcludeLister.java b/jslint4java-maven-plugin/src/main/java/com/googlecode/jslint4java/maven/FileTimestampExcludeLister.java new file mode 100644 index 0000000..68ca0e4 --- /dev/null +++ b/jslint4java-maven-plugin/src/main/java/com/googlecode/jslint4java/maven/FileTimestampExcludeLister.java @@ -0,0 +1,50 @@ +/** + * + */ +package com.googlecode.jslint4java.maven; + +import java.io.File; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; + +import org.codehaus.plexus.util.FileUtils; + + +/** + * Produce a list of files to be excluded if they haven't been modified + * @author danigiri + * @see TimestampFormatter + */ +public class FileTimestampExcludeLister { + + private List files; + private File reportFile; + + public FileTimestampExcludeLister(List files, File reportFile) { + this.files = files; + this.reportFile = reportFile; + } + + /** + * @return list of excluded files + * @throws IOException if report file can't be read + *//////////////////////////////////////////////////////////////////////////////// + public List files() throws IOException { + + List excludedFiles = new ArrayList(); + + String timestampsReport = FileUtils.fileRead(reportFile); + String[] timestampLines = timestampsReport.split("\n"); + for (int i=0;i files = getFilesToProcess(); + List allFiles = getAllSourceFiles(); + List files = filesAfterRemovingNonModifiedFrom(allFiles); + if (checkFileModificationTimes && files.size()>0) { + generateTimestampReport(allFiles); + } int failures = 0; ReportWriter reporter = makeReportWriter(); try { @@ -192,7 +211,7 @@ public void execute() throws MojoExecutionException, MojoFailureException { reporter.close(); } if (failures > 0) { - String message = "JSLint found " + failures + " problems in " + files.size() + " files"; + String message = "JSLint found " + failures + " problems in " + allFiles.size() + " files"; if (failOnError) { throw new MojoFailureException(message); } else { @@ -201,7 +220,7 @@ public void execute() throws MojoExecutionException, MojoFailureException { } } - private JSLint applyJSlintSource() throws MojoExecutionException { + private JSLint applyJSlintSource() throws MojoExecutionException { JSLintBuilder builder = new JSLintBuilder(); if (timeout > 0) { builder.timeout(timeout); @@ -228,11 +247,11 @@ String getEncoding() { * * @return a {@link List} of {@link File}s. */ - private List getFilesToProcess() throws MojoExecutionException { + private List getAllSourceFiles() throws MojoExecutionException { // Defaults. getLog().debug("includes=" + includes); getLog().debug("excludes=" + excludes); - + List files = new ArrayList(); for (File folder : sourceFolders) { getLog().debug("searching " + folder); @@ -243,11 +262,53 @@ private List getFilesToProcess() throws MojoExecutionException { throw new MojoExecutionException("Error listing files", e); } } - + return files; } - // Visible for testing only. + /** Return files to be excluded as they haven't been modified according to timestamp report + * @param files to be checked + * @return a {@link List} of {@link File}s to be excluded + * @throws MojoExecutionException if timestamp file can't be read + */ + private List filesNotModifiedAccordingToTimestampReport(List files) throws MojoExecutionException { + List notModifiedFiles = new ArrayList(); + File timestampsFile = new File(outputFolder, REPORT_TIMESTAMPS); + if (timestampsFile.exists()) { + FileTimestampExcludeLister excludeLister = new FileTimestampExcludeLister(files,timestampsFile); + try { + notModifiedFiles = excludeLister.files(); + } catch (IOException e) { + throw new MojoExecutionException("Couldn't read timestamp exclude file",e); + } + } + return notModifiedFiles; + } + + /** if we have set the option not to process untouched files we remove them from the list + * according to the timestamp report + */ + private List filesAfterRemovingNonModifiedFrom(List allFiles) throws MojoExecutionException { + List fileList = new ArrayList(); + fileList.addAll(allFiles); + if (checkFileModificationTimes) { + List unmodifiedFiles = filesNotModifiedAccordingToTimestampReport(allFiles); + if (unmodifiedFiles.size()>0) { + if (baseDirectory!=null) { // it's only null in testing + List unmodifiedFileRelativePaths = new ArrayList(); + String baseDirectoryPath = baseDirectory.getPath()+"/"; + for (File f : unmodifiedFiles) { + unmodifiedFileRelativePaths.add(f.getPath().replaceFirst(baseDirectoryPath, "")); + } + getLog().warn("Excluding non-modified files="+unmodifiedFileRelativePaths); + } + fileList.removeAll(unmodifiedFiles); + } + } + return fileList; + } + + // Visible for testing only. Map getOptions() { return options; } @@ -292,7 +353,21 @@ private void logIssuesToConsole(JSLintResult result) { } } - private ReportWriter makeReportWriter() { + private void generateTimestampReport(List files) { + ReportWriterImpl reporter = new ReportWriterImpl(new File(outputFolder, REPORT_TIMESTAMPS), + new TimestampFormatter()); + try { + reporter.open(); + for (File file : files) { + JSLintResult result = new JSLintResult.ResultBuilder(file.getPath()).build(); + reporter.report(result); + } + } finally { + reporter.close(); + } + } + + private ReportWriter makeReportWriter() { ReportWriterImpl f1 = new ReportWriterImpl(new File(outputFolder, JSLINT_XML), new JSLintXmlFormatter()); ReportWriterImpl f2 = new ReportWriterImpl(new File(outputFolder, JUNIT_XML), diff --git a/jslint4java-maven-plugin/src/main/java/com/googlecode/jslint4java/maven/ReportWriterImpl.java b/jslint4java-maven-plugin/src/main/java/com/googlecode/jslint4java/maven/ReportWriterImpl.java index 15603e3..c254086 100644 --- a/jslint4java-maven-plugin/src/main/java/com/googlecode/jslint4java/maven/ReportWriterImpl.java +++ b/jslint4java-maven-plugin/src/main/java/com/googlecode/jslint4java/maven/ReportWriterImpl.java @@ -80,4 +80,5 @@ public void report(JSLintResult result) { throw new RuntimeException(e); } } + } diff --git a/jslint4java-maven-plugin/src/main/java/com/googlecode/jslint4java/maven/TimestampFormatter.java b/jslint4java-maven-plugin/src/main/java/com/googlecode/jslint4java/maven/TimestampFormatter.java new file mode 100644 index 0000000..e1a37f1 --- /dev/null +++ b/jslint4java-maven-plugin/src/main/java/com/googlecode/jslint4java/maven/TimestampFormatter.java @@ -0,0 +1,39 @@ + +package com.googlecode.jslint4java.maven; + +import java.io.File; + +import com.googlecode.jslint4java.Issue; +import com.googlecode.jslint4java.JSLintResult; +import com.googlecode.jslint4java.formatter.JSLintResultFormatter; + + +/** + * Output filename paths and last modification date + * @author danigiri + */ +public class TimestampFormatter implements JSLintResultFormatter { + + + /** No footer required. */ + public String footer() { + return null; + } + + public String format(JSLintResult result) { + String nl = System.getProperty("line.separator"); + StringBuilder sb = new StringBuilder(); + String fileName = result.getName(); + sb.append(fileName); + sb.append(" "); + sb.append(new File(fileName).lastModified()); + sb.append(nl); + return sb.toString(); + } + + /** No footer required. */ + public String header() { + return null; + } + +} diff --git a/jslint4java-maven-plugin/src/test/java/com/googlecode/jslint4java/maven/FileTimestampExcludeListerTest.java b/jslint4java-maven-plugin/src/test/java/com/googlecode/jslint4java/maven/FileTimestampExcludeListerTest.java new file mode 100644 index 0000000..01d6565 --- /dev/null +++ b/jslint4java-maven-plugin/src/test/java/com/googlecode/jslint4java/maven/FileTimestampExcludeListerTest.java @@ -0,0 +1,133 @@ +/** + * + */ +package com.googlecode.jslint4java.maven; + +import static org.hamcrest.CoreMatchers.*; +import static org.junit.Assert.*; +import static org.junit.matchers.JUnitMatchers.*; + +import java.io.File; +import java.io.IOException; +import java.net.URISyntaxException; +import java.util.List; + +import org.codehaus.plexus.util.FileUtils; +import org.junit.Before; +import org.junit.Rule; +import org.junit.Test; +import org.junit.rules.TemporaryFolder; + +import com.googlecode.jslint4java.JSLintResult; + + +/** + * @author danigiri + */ +public class FileTimestampExcludeListerTest { + + @Rule + public TemporaryFolder tmpf = new TemporaryFolder(); + + private File sourceCopyDirectory; + private File reportFile; + private List sourceFiles; + + private void generateReportFrom(List files,File reportFile) { + + ReportWriterImpl reportWriter = new ReportWriterImpl(reportFile, new TimestampFormatter()); + try{ + reportWriter.open(); + for (File f : files) { + JSLintResult result = new JSLintResult.ResultBuilder(f.getPath()).build(); + reportWriter.report(result); + } + } catch (Exception e) { + fail("This report should work"+e.getMessage()); + } finally { + reportWriter.close(); + } + assertTrue("Report exists (paranoid)",reportFile.exists()); + + } + + + private List getExcludedFilesFromReport() throws IOException { + + FileTimestampExcludeLister excludeLister = new FileTimestampExcludeLister(sourceFiles,reportFile); + List excludedFiles = excludeLister.files(); + return excludedFiles; + + } + + + @Before + public void setUpSourceDirectory() throws Exception { + + try { + File sourceDirectory = new File(FileTimestampExcludeListerTest.class.getResource("good-js").toURI()); + // Not that I'm paranoid… + assertTrue("source exists", sourceDirectory.exists()); + assertTrue("source is a directory", sourceDirectory.isDirectory()); + sourceCopyDirectory = tmpf.newFolder(); + FileUtils.copyDirectory(sourceDirectory, sourceCopyDirectory); + File reportDirectory = tmpf.newFolder(); + reportFile = new File(reportDirectory,"timestamps.txt"); + sourceFiles = FileUtils.getFiles(sourceCopyDirectory, "*.js", "*.txt"); + generateReportFrom(sourceFiles, reportFile); + + } catch (URISyntaxException e) { + throw new RuntimeException(e); + } + + } + + + @Test + public void testExcludeAll() throws Exception { + + // should exclude all + List excludedFiles = getExcludedFilesFromReport(); + assertThat("excluded count",excludedFiles.size(),is(sourceFiles.size())); + + } + + + @Test + public void testExcludeNone() throws Exception { + + Thread.sleep(1001); // wait one second so timestamp actually changes + + for (File file : sourceFiles) { + FileUtils.fileAppend(file.getPath(), " "); + } + + List excludedFiles = getExcludedFilesFromReport(); + assertThat("excluded count", excludedFiles.size(), is(0)); + + } + + + @Test + public void testExcludeOne() throws Exception { + + Thread.sleep(1001); // wait one second so timestamp actually changes + + File modifiedFile = sourceFiles.get(0); + FileUtils.fileAppend(modifiedFile.getPath(), " "); + List excludedFiles = getExcludedFilesFromReport(); + assertEquals("excluded count", 1, excludedFiles.size()); + assertThat("not exclude modified", excludedFiles, not(hasItem(modifiedFile))); + + } + + + @Test(expected=IOException.class) + public void testReportFileDoesNotExist() throws IOException { + + FileTimestampExcludeLister excludeLister = new FileTimestampExcludeLister(sourceFiles,new File("doesntexist")); + excludeLister.files(); + fail("exception is not thrown"); + } + +} diff --git a/jslint4java-maven-plugin/src/test/java/com/googlecode/jslint4java/maven/JSLintMojoTest.java b/jslint4java-maven-plugin/src/test/java/com/googlecode/jslint4java/maven/JSLintMojoTest.java index a92d7df..86c50d9 100644 --- a/jslint4java-maven-plugin/src/test/java/com/googlecode/jslint4java/maven/JSLintMojoTest.java +++ b/jslint4java-maven-plugin/src/test/java/com/googlecode/jslint4java/maven/JSLintMojoTest.java @@ -9,6 +9,7 @@ import java.net.URL; import java.nio.charset.Charset; import java.util.Arrays; +import java.util.Date; import java.util.HashMap; import java.util.Map; import java.util.regex.Matcher; @@ -19,6 +20,7 @@ import org.apache.maven.plugin.MojoExecutionException; import org.apache.maven.plugin.MojoFailureException; import org.apache.maven.plugin.testing.AbstractMojoTestCase; +import org.codehaus.plexus.util.FileUtils; import org.codehaus.plexus.util.IOUtil; import org.junit.After; import org.junit.Before; @@ -47,6 +49,7 @@ public class JSLintMojoTest extends AbstractMojoTestCase { private File baseDir; private JSLintMojo mojo; private final FakeLog logger = new FakeLog(); + private File outputDir; private void assertLogContains(String expected) { for (FakeLog.LogItem item : logger.loggedItems) { @@ -64,7 +67,7 @@ private void assertLogContains(String expected) { * @return the expected file, for further inspection. */ private File assertFileExists(String filename) { - File expectedFile = new File(temp.getRoot(), filename); + File expectedFile = new File(outputDir, filename); assertTrue(expectedFile + " exists", expectedFile.exists()); assertTrue("file has non-zero length", expectedFile.length() > 0); return expectedFile; @@ -106,13 +109,18 @@ private String readFile(File reportFile) throws FileNotFoundException, IOExcepti @Override public void setUp() throws Exception { super.setUp(); - File pom = getResourceFile(POM_XML); - baseDir = pom.getParentFile(); + // we make a copy of the test folder so we can manipulate it if needed + File tempSourceFolder = temp.newFolder(); + File sourceFolder = getResourceFile(POM_XML).getParentFile(); + FileUtils.copyDirectoryStructure(sourceFolder, tempSourceFolder); + File pom = new File(tempSourceFolder,"pom.xml"); + baseDir = tempSourceFolder; mojo = (JSLintMojo) lookupMojo(GOAL, pom); mojo.setLog(logger); // We don't care about "use strict" for these tests. mojo.addOption(Option.SLOPPY, "true"); - mojo.setOutputFolder(temp.getRoot()); + outputDir = temp.newFolder(); + mojo.setOutputFolder(outputDir); } @After @@ -190,7 +198,7 @@ public void testLogToFileContents() throws Exception { @Test public void testLogToFileMakesDirectory() throws Exception { - assertTrue(temp.getRoot().delete()); + assertTrue(outputDir.delete()); testLogToFile(); } @@ -221,6 +229,41 @@ public void testOptionsFromPom() { assertEquals("true", options.get("sloppy")); } + // check we are generating the timestamp file when requested + @Test + public void testTimestampReportFile() throws Exception { + useGoodSource(); + mojo.execute(); + File timestamps = assertFileExists("timestamps.txt"); + Matcher m = Pattern.compile("\\.js \\d+").matcher(readFile(timestamps)); + assertTrue("Found first timestamp", m.find()); + assertTrue("Found second timestamp", m.find()); + assertFalse("Found no more timestamps", m.find()); + } + + // test touching files alters which files we deal with + @Test + public void testTimestampSkipping() throws Exception { + useGoodSource(); + mojo.execute(); + assertFileExists("timestamps.txt"); + + // should do nothing on second run and report files should have nothing on them + mojo.execute(); + File xmlReport = assertFileExists("jslint.xml"); + String xmlReportContent = readFile(xmlReport); + assertEquals("second run should not report anything", xmlReportContent, ""); + + // third run, touching one file + Thread.sleep(1001); + FileUtils.fileAppend(new File(baseDir,GOOD_JS+"/good.js").getPath(), "\n//comment\n"); +// new File(baseDir,GOOD_JS+"/good.js").setLastModified(new Date().getTime()); + mojo.execute(); + xmlReport = assertFileExists("jslint.xml"); + xmlReportContent = readFile(xmlReport); + assertTrue("third run contains good.js", xmlReportContent.contains("good.js")); + } + private void useBadSource() { mojo.setSourceFolders(Arrays.asList(baseRelative(BAD_JS))); } diff --git a/jslint4java-maven-plugin/src/test/java/com/googlecode/jslint4java/maven/MultiReportWriterTest.java b/jslint4java-maven-plugin/src/test/java/com/googlecode/jslint4java/maven/MultiReportWriterTest.java index def1048..b391edf 100644 --- a/jslint4java-maven-plugin/src/test/java/com/googlecode/jslint4java/maven/MultiReportWriterTest.java +++ b/jslint4java-maven-plugin/src/test/java/com/googlecode/jslint4java/maven/MultiReportWriterTest.java @@ -23,7 +23,7 @@ private void assertFileNotEmpty(File file) { assertThat(file + " is not empty", file.length() > 0, is(true)); } - private ReportWriter makeReportWriter(File aFile) { + private ReportWriter makeReportWriter(File aFile, boolean isAppending) { assertThat(aFile.exists(), is(false)); return new ReportWriterImpl(aFile, new PlainFormatter()); } @@ -37,10 +37,10 @@ private JSLintResult makeResult() { @Test public void shouldWriteToMultipleFiles() throws Exception { File aFile = new File(tmpf.getRoot(), "a"); - ReportWriter aWriter = makeReportWriter(aFile); + ReportWriter aWriter = makeReportWriter(aFile, false); File bFile = new File(tmpf.getRoot(), "b"); - ReportWriter bWriter = makeReportWriter(bFile); + ReportWriter bWriter = makeReportWriter(bFile, false); ReportWriter multi = new MultiReportWriter(aWriter, bWriter); multi.open(); diff --git a/jslint4java-maven-plugin/src/test/java/com/googlecode/jslint4java/maven/ReportWriterImplTest.java b/jslint4java-maven-plugin/src/test/java/com/googlecode/jslint4java/maven/ReportWriterImplTest.java index c25f5cd..c7c71c8 100644 --- a/jslint4java-maven-plugin/src/test/java/com/googlecode/jslint4java/maven/ReportWriterImplTest.java +++ b/jslint4java-maven-plugin/src/test/java/com/googlecode/jslint4java/maven/ReportWriterImplTest.java @@ -33,7 +33,26 @@ private ReportWriterImpl createReportWriter(String filename) { return new ReportWriterImpl(new File(tmpf.getRoot(), filename), formatter); } - @Test + private String readFile(File reportFile) throws FileNotFoundException, IOException { + InputStreamReader reader = null; + try { + reader = new InputStreamReader(new FileInputStream(reportFile), + Charset.forName("UTF-8")); + return IOUtil.toString(reader); + } finally { + IOUtil.close(reader); + } + } + + private void createReportWithoutProblems(ReportWriterImpl rw) { + + rw.open(); + // Create a result with no problems. + rw.report(new ResultBuilder("foo.js").build()); + rw.close(); + } + + @Test public void createsNonEmptyFile() { ReportWriterImpl rw = createReportWriter(REPORT_XML); rw.open(); @@ -74,27 +93,14 @@ public void closeDoesntHideFileNotFoundExceptionWithNullPointerException() throw } } - private String readFile(File reportFile) throws FileNotFoundException, IOException { - InputStreamReader reader = null; - try { - reader = new InputStreamReader(new FileInputStream(reportFile), - Charset.forName("UTF-8")); - return IOUtil.toString(reader); - } finally { - IOUtil.close(reader); - } - } - @Test public void reportContentsSanity() throws Exception { ReportWriterImpl rw = createReportWriter(REPORT_XML); - rw.open(); - // Create a result with no problems. - rw.report(new ResultBuilder("foo.js").build()); - rw.close(); + createReportWithoutProblems(rw); String report = readFile(rw.getReportFile()); assertThat(report, containsString("")); assertThat(report, containsString("")); assertThat(report, containsString("")); } + } diff --git a/jslint4java-maven-plugin/src/test/java/com/googlecode/jslint4java/maven/TimestampFormatterTest.java b/jslint4java-maven-plugin/src/test/java/com/googlecode/jslint4java/maven/TimestampFormatterTest.java new file mode 100644 index 0000000..e6ec258 --- /dev/null +++ b/jslint4java-maven-plugin/src/test/java/com/googlecode/jslint4java/maven/TimestampFormatterTest.java @@ -0,0 +1,75 @@ +/** + * + */ +package com.googlecode.jslint4java.maven; + +import static org.hamcrest.CoreMatchers.is; +import static org.hamcrest.CoreMatchers.nullValue; +import static org.junit.Assert.*; + +import java.io.File; +import java.util.List; + +import org.codehaus.plexus.util.FileUtils; +import org.junit.Before; +import org.junit.Test; + +import com.googlecode.jslint4java.JSLintResult; +import com.googlecode.jslint4java.JSLintResult.ResultBuilder; +import com.googlecode.jslint4java.formatter.PlainFormatter; + + +/** + * @author danigiri + */ +public class TimestampFormatterTest { + +private TimestampFormatter timestampFormatter; + +@Before +public void setUp() throws Exception { + timestampFormatter = new TimestampFormatter(); +} + +private String generateTimestampFormatterLineFor(File file) { + + JSLintResult build = new JSLintResult.ResultBuilder(file.getPath()).build(); + String fileTimestampLine = timestampFormatter.format(build); + return fileTimestampLine; +} + +@Test +public void shouldEmitNullFooter() { + assertThat(timestampFormatter.footer(), is(nullValue())); +} + +@Test +public void shouldEmitNullHeader() { + assertThat(timestampFormatter.header(), is(nullValue())); +} + + +/** + * Test method for {@link com.googlecode.jslint4java.maven.TimestampFormatter#format(com.googlecode.jslint4java.JSLintResult)}. + * @throws Exception + */ +@Test +public void testFormat() throws Exception { + File sourceDirectory = new File(TimestampFormatterTest.class.getResource("good-js").toURI()); + // Not that I'm paranoid… + assertTrue("source exists", sourceDirectory.exists()); + assertTrue("source is a directory", sourceDirectory.isDirectory()); + @SuppressWarnings("unchecked") + List files = FileUtils.getFiles(sourceDirectory, "*.js", "*.txt"); + for (File file : files) { + String fileTimestampLine = generateTimestampFormatterLineFor(file); + String[] resultLineSplit = fileTimestampLine.trim().split(" "); + assertThat(resultLineSplit.length, is(2)); + File formatterResultFile = new File(resultLineSplit[0]); + long timestamp = Long.parseLong(resultLineSplit[1]); + assertTrue("Filename on formatter result does not exist", files.contains(formatterResultFile)); + assertThat("Wrong timestamp on formatter result", formatterResultFile.lastModified(), is(timestamp)); + } +} + +} diff --git a/jslint4java-maven-plugin/src/test/resources/com/googlecode/jslint4java/maven/pom.xml b/jslint4java-maven-plugin/src/test/resources/com/googlecode/jslint4java/maven/pom.xml index 26357b2..1ad4839 100644 --- a/jslint4java-maven-plugin/src/test/resources/com/googlecode/jslint4java/maven/pom.xml +++ b/jslint4java-maven-plugin/src/test/resources/com/googlecode/jslint4java/maven/pom.xml @@ -14,6 +14,7 @@ true + true From d085214f0b129dd20b52a8251692cec1e38d9e94 Mon Sep 17 00:00:00 2001 From: Daniel Giribet Date: Wed, 2 May 2012 01:26:35 +0200 Subject: [PATCH 2/4] Added TODO for files with issues --- .../main/java/com/googlecode/jslint4java/maven/JSLintMojo.java | 1 + 1 file changed, 1 insertion(+) diff --git a/jslint4java-maven-plugin/src/main/java/com/googlecode/jslint4java/maven/JSLintMojo.java b/jslint4java-maven-plugin/src/main/java/com/googlecode/jslint4java/maven/JSLintMojo.java index 3239446..ac81fa8 100644 --- a/jslint4java-maven-plugin/src/main/java/com/googlecode/jslint4java/maven/JSLintMojo.java +++ b/jslint4java-maven-plugin/src/main/java/com/googlecode/jslint4java/maven/JSLintMojo.java @@ -41,6 +41,7 @@ */ // TODO Support alternate jslint // TODO Support HTML reports (site plugin mojo?) +// TODO make sure files with issues are processed all the time when skipping untouched files public class JSLintMojo extends AbstractMojo { /** Where to write the HTML report. */ From 7f10077c887c07c6d63269740e607d08fc61d531 Mon Sep 17 00:00:00 2001 From: Daniel Giribet Date: Wed, 2 May 2012 01:32:18 +0200 Subject: [PATCH 3/4] Added more detailed help for optional timestamp skip parameter --- .../java/com/googlecode/jslint4java/maven/JSLintMojo.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/jslint4java-maven-plugin/src/main/java/com/googlecode/jslint4java/maven/JSLintMojo.java b/jslint4java-maven-plugin/src/main/java/com/googlecode/jslint4java/maven/JSLintMojo.java index ac81fa8..bef3ab1 100644 --- a/jslint4java-maven-plugin/src/main/java/com/googlecode/jslint4java/maven/JSLintMojo.java +++ b/jslint4java-maven-plugin/src/main/java/com/googlecode/jslint4java/maven/JSLintMojo.java @@ -150,8 +150,9 @@ public class JSLintMojo extends AbstractMojo { private long timeout; /** - * Generate a timestamp file so unmodified files aren't checked twice - * + * Generate a timestamp file so unmodified files aren't checked on subsequent maven runs. + * Unmodified files will be skipped and will not show up on report files. + * (This includes files with issues that are left untouched. * @parameter expression="${jslint.checkFileModificationTimes}" default-value="false" */ private boolean checkFileModificationTimes = false; From b8f9852c10ac0a17b782f9aad9b85733d1ea074c Mon Sep 17 00:00:00 2001 From: Daniel Giribet Date: Wed, 2 May 2012 01:33:03 +0200 Subject: [PATCH 4/4] fixed formatting issue on comment --- .../main/java/com/googlecode/jslint4java/maven/JSLintMojo.java | 1 + 1 file changed, 1 insertion(+) diff --git a/jslint4java-maven-plugin/src/main/java/com/googlecode/jslint4java/maven/JSLintMojo.java b/jslint4java-maven-plugin/src/main/java/com/googlecode/jslint4java/maven/JSLintMojo.java index bef3ab1..60bc82a 100644 --- a/jslint4java-maven-plugin/src/main/java/com/googlecode/jslint4java/maven/JSLintMojo.java +++ b/jslint4java-maven-plugin/src/main/java/com/googlecode/jslint4java/maven/JSLintMojo.java @@ -153,6 +153,7 @@ public class JSLintMojo extends AbstractMojo { * Generate a timestamp file so unmodified files aren't checked on subsequent maven runs. * Unmodified files will be skipped and will not show up on report files. * (This includes files with issues that are left untouched. + * * @parameter expression="${jslint.checkFileModificationTimes}" default-value="false" */ private boolean checkFileModificationTimes = false;