-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feature/python * adds Python as a supported language (see #9) * add black codeformatter (requires python3.6+) * install python3.7-minimal and pip3 * add config file for custom options * Fix typo: Blacked -> Black
- Loading branch information
1 parent
994abac
commit 76fdfdb
Showing
5 changed files
with
42 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
[tool.black] | ||
line-length = 120 | ||
target-version = ['py27', 'py36', 'py37', 'py38'] |
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
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 |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<?php | ||
|
||
namespace DevCommunityDE\CodeFormatter\CodeFormatter; | ||
|
||
/** | ||
* Class BlackPythonCodeFormatter | ||
* | ||
* @package DevCommunityDE\CodeFormatter\CodeFormatter | ||
*/ | ||
class BlackPythonCodeFormatter extends CodeFormatter | ||
{ | ||
|
||
/** | ||
* @var array | ||
*/ | ||
protected static $supported_languages = [ | ||
'python', | ||
]; | ||
|
||
/** | ||
* @param string $file | ||
* @return string | ||
*/ | ||
protected function getShellCommand(string $file) : string | ||
{ | ||
return 'black --quiet --config ' . __DIR__ . '/../../.black-format.toml \'' . $file . '\''; | ||
} | ||
} |
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