-
-
Notifications
You must be signed in to change notification settings - Fork 237
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Note about
risky
rules and how to fix rule violations with PHP-CS-F…
…ixer (#4249) * a note about risky rules and how to fix rule violations with PHP-CS-Fixer * [MegaLinter] Apply linters fixes --------- Co-authored-by: llaville <[email protected]>
- Loading branch information
Showing
2 changed files
with
20 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,9 +6,9 @@ | |
import logging | ||
import os | ||
import shutil | ||
|
||
import chalk as c | ||
import git | ||
|
||
from megalinter import Reporter, config, utils | ||
|
||
|
||
|
@@ -87,16 +87,23 @@ def produce_report(self): | |
) | ||
else: | ||
try: | ||
repo = git.Repo(os.path.realpath(self.master.github_workspace)) | ||
repo.config_writer().set_value("user", "name", "MegaLinter").release() | ||
repo.config_writer().set_value("user", "email", "[email protected]").release() | ||
repo = git.Repo( | ||
os.path.realpath(self.master.github_workspace) | ||
) | ||
repo.config_writer().set_value( | ||
"user", "name", "MegaLinter" | ||
).release() | ||
repo.config_writer().set_value( | ||
"user", "email", "[email protected]" | ||
).release() | ||
repo.git.add(update=True) | ||
repo.git.commit('-m', '[MegaLinter] Apply linters fixes') | ||
repo.git.push('origin', f'HEAD:{remote_branch}') | ||
repo.git.commit("-m", "[MegaLinter] Apply linters fixes") | ||
repo.git.push("origin", f"HEAD:{remote_branch}") | ||
except git.GitCommandError as git_err: | ||
logging.error( | ||
c.red( | ||
"❌ [Updated Sources Reporter] Failed to git push auto fixes: " + str(git_err.stderr) | ||
"❌ [Updated Sources Reporter] Failed to git push auto fixes: " | ||
+ str(git_err.stderr) | ||
) | ||
) | ||
logging.warning( | ||
|
@@ -107,7 +114,7 @@ def produce_report(self): | |
) | ||
else: | ||
logging.info( | ||
"[Updated Sources Reporter] Fixed source files have automatically " | ||
"[Updated Sources Reporter] Fixed source files have automatically " | ||
"been pushed to the source branch" | ||
) | ||
else: | ||
|