Skip to content

Commit

Permalink
Merge pull request #42 from sylbru/sylbru-allow-risky
Browse files Browse the repository at this point in the history
Allow risky fixers with `allow_risky` setting
  • Loading branch information
adael authored Feb 7, 2023
2 parents 9d9b3f0 + 4fca259 commit 694c3d2
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions SublimePhpCsFixer.py
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,7 @@ def run(self, tmp_file):
def create_cmd(self, tmp_file):
config = self.config_param()
rules = self.rules_param()
allow_risky = self.allow_risky_param()

if rules and config:
self.logger.console("rules and config are both present, rules prevails")
Expand All @@ -186,6 +187,7 @@ def create_cmd(self, tmp_file):
"fix",
rules,
config,
allow_risky,
"--using-cache=no",
tmp_file,
]))
Expand Down Expand Up @@ -228,6 +230,12 @@ def rules_param(self):

return None

def allow_risky_param(self):
if self.settings.get("allow_risky"):
return "--allow-risky=yes"

return None

def get_configured_php_cs_fixer_path(self):
path = self.settings.get_expanded('path')

Expand Down

0 comments on commit 694c3d2

Please sign in to comment.