From 544affd3c4764cbd85f2bf062de155112a4c11b9 Mon Sep 17 00:00:00 2001 From: Florian Breisch Date: Thu, 18 Feb 2016 19:14:39 +0100 Subject: [PATCH 1/2] partially disable max_line_length of coffee lint --- lib/init.coffee | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/init.coffee b/lib/init.coffee index 7ba728d..5cce7a5 100755 --- a/lib/init.coffee +++ b/lib/init.coffee @@ -6,6 +6,7 @@ fs = require 'fs' cpConfigFileName = '.classpath' module.exports = + # coffeelint: disable=max_line_length config: javacExecutablePath: type: 'string' @@ -34,10 +35,12 @@ module.exports = description: 'Your additional options will be inserted between the javac-command and the sourcefiles. Example: `-d /root/class-cache` will become `javac -Xlint:all -d /root/class-cache .../Test.java` - take a look to the [javac-docs](http://docs.oracle.com/javase/8/docs/technotes/tools/unix/javac.html) + take a look to the + [javac-docs](http://docs.oracle.com/javase/8/docs/technotes/tools/unix/javac.html) for further information on valid options. Keep in mind that placeholders like `~` do **not** work.' + activate: -> require('atom-package-deps').install() @subscriptions = new CompositeDisposable @@ -55,6 +58,8 @@ module.exports = else @additionalOptions = [] + # coffeelint: enable=max_line_length + deactivate: -> @subscriptions.dispose() From 6ae57142ccbbb5fdfa860b15b7278e373799ad4a Mon Sep 17 00:00:00 2001 From: Florian Breisch Date: Thu, 18 Feb 2016 19:15:30 +0100 Subject: [PATCH 2/2] add quick fix to cut too many source-files off --- lib/init.coffee | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/lib/init.coffee b/lib/init.coffee index 5cce7a5..403c1ec 100755 --- a/lib/init.coffee +++ b/lib/init.coffee @@ -1,4 +1,5 @@ {Directory, CompositeDisposable} = require 'atom' +_os = require 'os' path = require 'path' helpers = require 'atom-linter' voucher = require 'voucher' @@ -104,6 +105,37 @@ module.exports = args.push.apply(args, files) + + + + # TODO: remove this quick fix + # count the size of expected execution-command + # see issue #58 for further details + cliLimit = if _os.platform() == 'win32' then 7900 else 130000 + expectedCmdSize = @javaExecutablePath.length + sliceIndex = 0 + for arg in args + expectedCmdSize++ # add prepending space + if (typeof arg) == 'string' + expectedCmdSize += arg.length + else + expectedCmdSize += arg.toString().length + if expectedCmdSize < cliLimit + sliceIndex++ + + if sliceIndex < (args.length - 1) + # coffeelint: disable=max_line_length + console.warn """ +linter-javac: The lint-command is presumed to break the limit of #{cliLimit} characters on the #{_os.platform()}-platform. +Dropping #{args.length - sliceIndex} source files, as a result javac may not resolve all dependencies. +""" + # coffeelint: enable=max_line_length + args.push(filePath) + args = args.slice(0, sliceIndex) + + + + # Execute javac helpers.exec(@javaExecutablePath, args, {stream: 'stderr', cwd: wd}) .then (val) =>