
"""This module exports the Scalac plugin class."""

from SublimeLinter.lint import Linter, util


class Scalac(Linter):

    """Provides an interface to scalac."""

    syntax = ''
    cmd = 'scalac'
    executable = None
    version_args = '--version'
    version_re = r'(?P<version>\d+\.\d+\.\d+)'
    version_requirement = '>= 1.0'
    regex = r''
    multiline = False
    line_col_base = (1, 1)
    tempfile_suffix = None
    error_stream = util.STREAM_BOTH
    selectors = {}
    word_re = None
    defaults = {}
    inline_settings = None
    inline_overrides = None
    comment_re = None


"""This module exports the Scalac plugin class."""

from SublimeLinter.lint import Linter, util


class Scalac(Linter):

    """Provides an interface to scalac."""

    syntax = 'scala'
    executable = 'scalac'
    version_args = '-version'
    version_re = r'(?P<version>\d+\.\d+\.\d+)'
    version_requirement = '>= 2.11'
    regex = (
        r'^(?P<file>.+?):(?P<line>\d+): '
        r'(?:(?P<error>error)|(?P<warning>warning)): '
        r'(?:\[.+?\] )?(?P<message>[^\r\n]+)\r?\n'
        r'[^\r\n]+\r?\n'
        r'(?P<col>[^\^]*)\^'
    )
    multiline = True
    # line_col_base = (1, 1)
    tempfile_suffix = '-'
    error_stream = util.STREAM_STDERR
    # selectors = {}
    # word_re = None
    defaults = {
        'lint': ''
    }
    inline_settings = 'lint'
    # inline_overrides = None
    comment_re = r'\s*/[/*]'

    def cmd(self):
        """
        Return the command line to execute.

        We override this because we have to munge the -Xlint argument
        based on the 'lint' setting.

        """

        xlint = '-Xlint'
        settings = self.get_view_settings()
        options = settings.get('lint')

        if options:
            xlint += ':' + options

        return (self.executable_path, xlint, '-encoding', 'UTF8', '*')

    def split_match(self, match):
        """
        Return the components of the match.

        We override this because scalac lints all referenced files,
        and we only want errors from the linted file.

        """

        if match:
            if match.group('file') != self.filename:
                match = None

        return super().split_match(match)
Use SublimeLinter-javac as a base
Use SublimeLinter-javac as a base

  
  """This module exports the Scalac plugin class."""
  
  from SublimeLinter.lint import Linter, util
  
  
  class Scalac(Linter):
  
      """Provides an interface to scalac."""
  
-     syntax = ''
+     syntax = 'scala'
+     executable = 'scalac'
-     cmd = 'scalac'
-     executable = None
-     version_args = '--version'
+     version_args = '-version'
      version_re = r'(?P<version>\d+\.\d+\.\d+)'
-     version_requirement = '>= 1.0'
+     version_requirement = '>= 2.11'
-     regex = r''
+     regex = (
+         r'^(?P<file>.+?):(?P<line>\d+): '
+         r'(?:(?P<error>error)|(?P<warning>warning)): '
+         r'(?:\[.+?\] )?(?P<message>[^\r\n]+)\r?\n'
+         r'[^\r\n]+\r?\n'
+         r'(?P<col>[^\^]*)\^'
+     )
-     multiline = False
+     multiline = True
-     line_col_base = (1, 1)
+     # line_col_base = (1, 1)
-     tempfile_suffix = None
+     tempfile_suffix = '-'
-     error_stream = util.STREAM_BOTH
+     error_stream = util.STREAM_STDERR
-     selectors = {}
+     # selectors = {}
-     word_re = None
+     # word_re = None
-     defaults = {}
+     defaults = {
+         'lint': ''
+     }
-     inline_settings = None
+     inline_settings = 'lint'
-     inline_overrides = None
+     # inline_overrides = None
-     comment_re = None
+     comment_re = r'\s*/[/*]'
  
+     def cmd(self):
+         """
+         Return the command line to execute.
+ 
+         We override this because we have to munge the -Xlint argument
+         based on the 'lint' setting.
+ 
+         """
+ 
+         xlint = '-Xlint'
+         settings = self.get_view_settings()
+         options = settings.get('lint')
+ 
+         if options:
+             xlint += ':' + options
+ 
+         return (self.executable_path, xlint, '-encoding', 'UTF8', '*')
+ 
+     def split_match(self, match):
+         """
+         Return the components of the match.
+ 
+         We override this because scalac lints all referenced files,
+         and we only want errors from the linted file.
+ 
+         """
+ 
+         if match:
+             if match.group('file') != self.filename:
+                 match = None
+ 
+         return super().split_match(match)
Use SublimeLinter-javac as a base
## Code Before:

"""This module exports the Scalac plugin class."""

from SublimeLinter.lint import Linter, util


class Scalac(Linter):

    """Provides an interface to scalac."""

    syntax = ''
    cmd = 'scalac'
    executable = None
    version_args = '--version'
    version_re = r'(?P<version>\d+\.\d+\.\d+)'
    version_requirement = '>= 1.0'
    regex = r''
    multiline = False
    line_col_base = (1, 1)
    tempfile_suffix = None
    error_stream = util.STREAM_BOTH
    selectors = {}
    word_re = None
    defaults = {}
    inline_settings = None
    inline_overrides = None
    comment_re = None

## Instruction:
Use SublimeLinter-javac as a base
## Code After:

"""This module exports the Scalac plugin class."""

from SublimeLinter.lint import Linter, util


class Scalac(Linter):

    """Provides an interface to scalac."""

    syntax = 'scala'
    executable = 'scalac'
    version_args = '-version'
    version_re = r'(?P<version>\d+\.\d+\.\d+)'
    version_requirement = '>= 2.11'
    regex = (
        r'^(?P<file>.+?):(?P<line>\d+): '
        r'(?:(?P<error>error)|(?P<warning>warning)): '
        r'(?:\[.+?\] )?(?P<message>[^\r\n]+)\r?\n'
        r'[^\r\n]+\r?\n'
        r'(?P<col>[^\^]*)\^'
    )
    multiline = True
    # line_col_base = (1, 1)
    tempfile_suffix = '-'
    error_stream = util.STREAM_STDERR
    # selectors = {}
    # word_re = None
    defaults = {
        'lint': ''
    }
    inline_settings = 'lint'
    # inline_overrides = None
    comment_re = r'\s*/[/*]'

    def cmd(self):
        """
        Return the command line to execute.

        We override this because we have to munge the -Xlint argument
        based on the 'lint' setting.

        """

        xlint = '-Xlint'
        settings = self.get_view_settings()
        options = settings.get('lint')

        if options:
            xlint += ':' + options

        return (self.executable_path, xlint, '-encoding', 'UTF8', '*')

    def split_match(self, match):
        """
        Return the components of the match.

        We override this because scalac lints all referenced files,
        and we only want errors from the linted file.

        """

        if match:
            if match.group('file') != self.filename:
                match = None

        return super().split_match(match)