Skip to content

Commit

Permalink
Removal of Scheck
Browse files Browse the repository at this point in the history
Justification is that Scheck (pfff) is now archived:
https://github.com/facebookarchive/pfff
  • Loading branch information
benmatselby committed Oct 14, 2023
1 parent 3b4adb2 commit a0c16d2
Show file tree
Hide file tree
Showing 5 changed files with 123 additions and 238 deletions.
4 changes: 4 additions & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# CHANGELOG

## 7.0.0

- Removal of Scheck.

## 6.9.0

- Turn on tagging
Expand Down
10 changes: 0 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ This is a plugin for Sublime Text which provides checkstyle reports using the fo
- PHP_CodeSniffer (`phpcs`)
- Linter (`php -l`)
- PHP Mess Detector (`phpmd`)
- Scheck (`scheck`, part of Facebook’s pfff toolchain)

You can also configure the plugin to fix the issues using either

Expand Down Expand Up @@ -65,7 +64,6 @@ which phpcbf
- Ability to run PHP_CodeSniffer
- Ability to run php -l on the open file
- Ability to run PHP Mess Detector on the open file
- Ability to run Scheck on the open file
- Show cached results from PHP_CodeSniffer in open file
- Show errors in the Quick Panel
- Show errors in the Gutter
Expand Down Expand Up @@ -133,14 +131,6 @@ You can also define the configuration for the following settings, be it for a pr
- `phpmd_executable_path` – The path to the phpmd executable. If empty string, use PATH to find it
- `phpmd_additional_args` – This is the extra information you want to pass to the phpmd command. For example which “rulesets” you want to run

### Scheck

- `scheck_run` - Do you want the scheck application to run? Off by default
- `scheck_command_on_save` - Do you want the command to execute on save?
- `scheck_executable_path` - The path to the scheck executable. If empty string, use PATH to find it
- `scheck_additional_args` - This is the extra information you want to pass to the scheck command.
Examples of the settings files can be found here

### Project Based Settings

Your .project file should look something like this:
Expand Down
16 changes: 0 additions & 16 deletions example-settings/nix-all-commands.example
Original file line number Diff line number Diff line change
Expand Up @@ -90,20 +90,4 @@
"phpmd_additional_args": {
"codesize,unusedcode,naming": ""
},

// PHP Scheck settings
// Execute scheck
"scheck_run": true,

// Execute the scheck on file save
"scheck_command_on_save": false,

// It seems python/sublime cannot always find the scheck application
// If empty, then use PATH version of scheck, else use the set value
"scheck_executable_path": "/Users/Ben/git/external/pfff/scheck",

// Additional arguments you can specify into the application
"scheck_additional_args": {
"-strict" : ""
}
}
58 changes: 0 additions & 58 deletions phpcs.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,6 @@ class Pref:
"phpmd_command_on_save",
"phpmd_executable_path",
"phpmd_additional_args",
"scheck_run",
"scheck_command_on_save",
"scheck_executable_path",
"scheck_additional_args",
]

def load(self):
Expand Down Expand Up @@ -419,52 +415,6 @@ def parse_report(self, args):
self.error_list.append(error)


class Scheck(ShellCommand):
"""Concrete class for Scheck"""

def execute(self, path):
if pref.scheck_run != True:
return

args = []

if (
pref.phpcs_php_prefix_path != ""
and self.__class__.__name__ in pref.phpcs_commands_to_php_prefix
):
args = [pref.phpcs_php_prefix_path]

if pref.scheck_executable_path != "":
application_path = pref.scheck_executable_path
else:
application_path = "scheck"

if len(args) > 0:
args.append(application_path)
else:
args = [application_path]

for key, value in pref.scheck_additional_args.items():
args.append(key)
if value != "":
args.append(value)

args.append(os.path.normpath(path))

self.parse_report(args)

def parse_report(self, args):
report = self.shell_out(args)
debug_message(report)
lines = re.finditer(
".*:(?P<line>\d+):(?P<column>\d+): CHECK: (?P<message>.*)", report
)

for line in lines:
error = CheckstyleError(line.group("line"), line.group("message"))
self.error_list.append(error)


class Linter(ShellCommand):
"""Content class for php -l"""

Expand Down Expand Up @@ -536,10 +486,6 @@ def run(self, path, event=None):
self.checkstyle_reports.append(
["MessDetector", MessDetector().get_errors(path), "dot"]
)
if pref.scheck_run:
self.checkstyle_reports.append(
["Scheck", Scheck().get_errors(path), "dot"]
)
else:
if pref.phpcs_linter_command_on_save and pref.phpcs_linter_run:
self.checkstyle_reports.append(
Expand All @@ -553,10 +499,6 @@ def run(self, path, event=None):
self.checkstyle_reports.append(
["MessDetector", MessDetector().get_errors(path), "dot"]
)
if pref.scheck_command_on_save and pref.scheck_run:
self.checkstyle_reports.append(
["Scheck", Scheck().get_errors(path), "dot"]
)

sublime.set_timeout(self.generate, 0)

Expand Down
Loading

0 comments on commit a0c16d2

Please sign in to comment.