예제 #1
0
    def cmd(self):
        """Read cmd from inline settings."""
        settings = Linter.get_view_settings(self)

        if 'cmd' in settings:
            command = [settings.get('cmd')]
        else:
            command = [self.executable_path]

        if 'config_file' in settings:
            config_file = settings.get('config_file')
        else:
            config_file = self.config_file

        command.append('fix')
        command.append('@')
        command.append('--dry-run')
        command.append('--diff')
        command.append('--diff-format=udiff')
        command.append('--using-cache=no')
        command.append('--no-ansi')
        command.append('--config=' + config_file)
        command.append('-vv')

        return command
예제 #2
0
    def cmd(self):
        """Read cmd from inline settings."""
        settings = Linter.get_view_settings(self)

        if 'cmd' in settings:
            command = [settings.get('cmd')]
        else:
            command = [self.executable_path]

        if 'config_file' in settings:
            config_file = settings.get('config_file')
        else:
            config_file = _find_configuration_file(self.view.file_name())
            if not config_file:
                config_file = self.config_file

        command.append('fix')
        command.append('@')
        command.append('--dry-run')
        command.append('--diff')

        # Note: This option requires php-cs-fixer >= 2.7
        command.append('--diff-format=udiff')

        command.append('--using-cache=no')
        command.append('--no-ansi')
        command.append('--config=' + config_file)
        command.append('-vv')

        return command
    def cmd(self):
        """Read cmd from inline settings."""
        settings = Linter.get_view_settings(self)

        if 'cmd' in settings:
            command = [settings.get('cmd')]
        else:
            command = [self.executable_path]

        command.append('--report=checkstyle')

        return command
예제 #4
0
    def cmd(self):
        """Read cmd from inline settings."""
        settings = Linter.get_view_settings(self)

        if 'cmd' in settings:
            command = [settings.get('cmd')]
        else:
            command = [self.executable_path]

        command.append('--report=checkstyle')

        return command
예제 #5
0
    def cmd(self):
        """Create the cmd."""
        settings = Linter.get_view_settings(self)

        # attempt to get the command from settings if it is present
        if 'cmd' in settings:
            command = [settings.get('cmd')]
        else:
            command = [self.executable_path]

        command.append('@')
        command.append('text')

        return command
예제 #6
0
    def cmd(self):
        """Create the cmd."""
        settings = Linter.get_view_settings(self)

        # attempt to get the command from settings if it is present
        if 'cmd' in settings:
            command = [settings.get('cmd')]
        else:
            command = [self.executable_path]

        command.append('@')
        command.append('text')

        return command
    def cmd(self):
        """Read cmd from inline settings."""
        settings = Linter.get_view_settings(self)

        if 'cmd' in settings:
            command = [settings.get('cmd')]
        else:
            command = [self.executable_path]

        command.append('fix')
        command.append('@')
        command.append('--diff')
        command.append('--format=xml')
        command.append('-vv')

        return command
    def cmd(self):
        """Read cmd from inline settings."""
        settings = Linter.get_view_settings(self)

        if 'cmd' in settings:
            command = [settings.get('cmd')]
        else:
            command = [self.executable_path]

        command.append('fix')
        command.append('@')
        command.append('--diff')
        command.append('--format=xml')
        command.append('-vv')

        return command
예제 #9
0
    def cmd(self):
        """Read cmd from inline settings."""
        settings = Linter.get_view_settings(self)

        if 'cmd' in settings:
            command = [settings.get('cmd')]
        else:
            command = [self.executable_path]

        command.append('-l')
        command.append('-n')
        command.append('-d')
        command.append('display_errors=On')
        command.append('-d')
        command.append('log_errors=Off')

        return command
예제 #10
0
    def cmd(self):
        """Create the command."""
        settings = Linter.get_view_settings(self)

        # Default arguments
        cmd = ['makensis']

        linter_args = settings.get('args') or []
        strict = settings.get('strict') or False
        preprocess_mode = settings.get('preprocess_mode')
        preprocess_mode = "-{}".format(preprocess_mode) if str(
            preprocess_mode).upper() in ('PPO', 'SAFEPPO') else False

        cmd = cmd + linter_args

        # Set verbosity
        verbose_flags = [
            '-V0', '-V1', '-V2', '-V4', '-V4', '/V0', '/V1', '/V2', '/V4',
            '/V4'
        ]
        if not any(x in cmd for x in verbose_flags):
            cmd.append('-V2')

        # Is strict mode?
        strict_flags = ['-WX', '/WX']
        if strict and not any(x in cmd for x in strict_flags):
            cmd.append('-WX')

        # Is PPO mode?
        ppo_flags = ['-PPO', '-SAFEPPO', '/PPO', '/SAFEPPO']
        if preprocess_mode and any(x in preprocess_mode for x in ppo_flags):
            cmd.append(preprocess_mode)
            cmd.append("${file}")
        else:
            cmd.append("${file}")

            # Don't write installer
            if platform == 'win32':
                out_file = 'OutFile NUL'
            else:
                out_file = 'OutFile /dev/null/'

            cmd.append('-X' + out_file)

        return cmd
예제 #11
0
    def cmd(self):
        """Read cmd from inline settings."""
        settings = Linter.get_view_settings(self)

        if 'cmd' in settings:
            logger.warning('The setting `cmd` has been deprecated. '
                           'Use `executable` instead.')
            command = [settings.get('cmd')]
        else:
            command = ['php']

        command.append('-l')
        command.append('-n')
        command.append('-d')
        command.append('display_errors=On')
        command.append('-d')
        command.append('log_errors=Off')

        return command
예제 #12
0
    def cmd(self):
        """Read cmd from inline settings."""
        settings = Linter.get_view_settings(self)

        if 'cmd' in settings:
            logger.warning('The setting `cmd` has been deprecated. '
                           'Use `executable` instead.')
            command = [settings.get('cmd')]
        else:
            command = ['php']

        command.append('-l')
        command.append('-n')
        command.append('-d')
        command.append('display_errors=On')
        command.append('-d')
        command.append('log_errors=Off')

        return command
예제 #13
0
    def split_match(self, match):
        """Extract and return values from match."""
        match, line, col, error, warning, message, near = (
            super().split_match(match))

        if message:
            return match, line, col, error, warning, message, near

        # Is strict mode?
        settings = Linter.get_view_settings(self)
        if settings.get('strict') is True:
            error = warning

        warnMessage = str(match.groupdict()["warnMessage"])
        warnLine = match.groupdict()["warnLine"]

        if warnMessage and warnLine:
            message = warnMessage
            line = int(warnLine) - 1

        return match, line, col, error, warning, message, near