Perl support (using perltidy) (see Glavin001/atom-beautify#33)
This commit is contained in:
parent
a25ad22a8d
commit
f64d2bae20
|
@ -34,6 +34,7 @@ Or Settings/Preferences ➔ Packages ➔ Search for `atom-beautify`
|
||||||
- Requires [python-sqlparse](https://github.com/andialbrecht/sqlparse)
|
- Requires [python-sqlparse](https://github.com/andialbrecht/sqlparse)
|
||||||
- [x] [Markdown](https://github.com/Glavin001/atom-beautify/issues/93#issuecomment-55642483)
|
- [x] [Markdown](https://github.com/Glavin001/atom-beautify/issues/93#issuecomment-55642483)
|
||||||
- Requires [Pandoc](http://johnmacfarlane.net/pandoc/) to be already installed
|
- Requires [Pandoc](http://johnmacfarlane.net/pandoc/) to be already installed
|
||||||
|
- [X] [Perl](https://github.com/Glavin001/atom-beautify/issues/33)
|
||||||
- [x] [PHP](https://github.com/donaldpipowitch/atom-beautify/issues/26)
|
- [x] [PHP](https://github.com/donaldpipowitch/atom-beautify/issues/26)
|
||||||
- Requires [PHP_Beautifier](http://pear.php.net/package/PHP_Beautifier) to be already installed.
|
- Requires [PHP_Beautifier](http://pear.php.net/package/PHP_Beautifier) to be already installed.
|
||||||
- [x] [Python](https://github.com/donaldpipowitch/atom-beautify/issues/24)
|
- [x] [Python](https://github.com/donaldpipowitch/atom-beautify/issues/24)
|
||||||
|
@ -60,13 +61,6 @@ Or Settings/Preferences ➔ Packages ➔ Search for `atom-beautify`
|
||||||
- Requires [Uncrustify](http://sourceforge.net/projects/uncrustify/)
|
- Requires [Uncrustify](http://sourceforge.net/projects/uncrustify/)
|
||||||
- [x] [TypeScript](https://github.com/Glavin001/atom-beautify/issues/49)
|
- [x] [TypeScript](https://github.com/Glavin001/atom-beautify/issues/49)
|
||||||
|
|
||||||
### Road Map
|
|
||||||
|
|
||||||
#### Language support
|
|
||||||
|
|
||||||
- [ ] [Perl](https://github.com/Glavin001/atom-beautify/issues/33)
|
|
||||||
|
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
|
|
||||||
Open the [Command Palette](https://github.com/atom/command-palette), and type `Beautify`.
|
Open the [Command Palette](https://github.com/atom/command-palette), and type `Beautify`.
|
||||||
|
|
|
@ -0,0 +1,24 @@
|
||||||
|
###
|
||||||
|
// Requires [perltidy](http://perltidy.sourceforge.net)
|
||||||
|
###
|
||||||
|
|
||||||
|
"use strict"
|
||||||
|
|
||||||
|
getCmd = (inputPath, outputPath, options) ->
|
||||||
|
# console.debug "[perl-beautify] options: " + JSON.stringify(options)
|
||||||
|
args = [
|
||||||
|
'"' + options.perltidy_path + '"'
|
||||||
|
'--standard-output'
|
||||||
|
'--standard-error-output'
|
||||||
|
'--quiet'
|
||||||
|
]
|
||||||
|
if options.perltidy_profile
|
||||||
|
args.push '"--profile=' + options.perltidy_profile + '"'
|
||||||
|
args.push '"' + inputPath + '"'
|
||||||
|
cmd = args.join(' ')
|
||||||
|
# console.debug "[perl-beautify] cmd: " + cmd
|
||||||
|
return cmd
|
||||||
|
|
||||||
|
cliBeautify = require("./cli-beautify")
|
||||||
|
isStdout = true
|
||||||
|
module.exports = cliBeautify(getCmd, isStdout)
|
|
@ -10,6 +10,7 @@ beautifyJS = null
|
||||||
beautifyHTML = null
|
beautifyHTML = null
|
||||||
beautifyCSS = null
|
beautifyCSS = null
|
||||||
beautifySQL = null
|
beautifySQL = null
|
||||||
|
beautifyPerl = null
|
||||||
beautifyPHP = null
|
beautifyPHP = null
|
||||||
beautifyPython = null
|
beautifyPython = null
|
||||||
beautifyRuby = null
|
beautifyRuby = null
|
||||||
|
@ -38,6 +39,7 @@ module.exports =
|
||||||
"html"
|
"html"
|
||||||
"css"
|
"css"
|
||||||
"sql"
|
"sql"
|
||||||
|
"perl"
|
||||||
"php"
|
"php"
|
||||||
"python"
|
"python"
|
||||||
"ruby"
|
"ruby"
|
||||||
|
@ -97,6 +99,10 @@ module.exports =
|
||||||
# Markdown
|
# Markdown
|
||||||
markdown_pandoc_path: ""
|
markdown_pandoc_path: ""
|
||||||
|
|
||||||
|
# Perl
|
||||||
|
perl_perltidy_path: "perltidy"
|
||||||
|
perl_perltidy_profile: ""
|
||||||
|
|
||||||
# PHP
|
# PHP
|
||||||
php_beautifier_path: ""
|
php_beautifier_path: ""
|
||||||
|
|
||||||
|
@ -183,6 +189,9 @@ module.exports =
|
||||||
when "SQL (Rails)", "SQL"
|
when "SQL (Rails)", "SQL"
|
||||||
beautifySQL ?= require("./langs/sql-beautify")
|
beautifySQL ?= require("./langs/sql-beautify")
|
||||||
beautifySQL text, self.getOptions("sql", allOptions), beautifyCompleted
|
beautifySQL text, self.getOptions("sql", allOptions), beautifyCompleted
|
||||||
|
when "Perl"
|
||||||
|
beautifyPerl ?= require("./langs/perl-beautify")
|
||||||
|
beautifyPerl text, self.getOptions("perl", allOptions), beautifyCompleted
|
||||||
when "PHP"
|
when "PHP"
|
||||||
beautifyPHP ?= require("./langs/php-beautify")
|
beautifyPHP ?= require("./langs/php-beautify")
|
||||||
beautifyPHP text, self.getOptions("php", allOptions), beautifyCompleted
|
beautifyPHP text, self.getOptions("php", allOptions), beautifyCompleted
|
||||||
|
|
Loading…
Reference in New Issue