From 0f6c205047a7e705c2a695cf92673df87910fb90 Mon Sep 17 00:00:00 2001 From: Steven Zeck <8315038+szeck87@users.noreply.github.com> Date: Mon, 30 Oct 2017 23:16:47 -0500 Subject: [PATCH 01/49] Add stale.yml for Stale probot --- .github/stale.yml | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 .github/stale.yml diff --git a/.github/stale.yml b/.github/stale.yml new file mode 100644 index 0000000..32e4a6b --- /dev/null +++ b/.github/stale.yml @@ -0,0 +1,17 @@ +# Number of days of inactivity before an issue becomes stale +daysUntilStale: 60 +# Number of days of inactivity before a stale issue is closed +daysUntilClose: 7 +# Issues with these labels will never be considered stale +exemptLabels: + - high priority + - pending-publication +# Label to use when marking an issue as stale +staleLabel: stale +# Comment to post when marking an issue as stale. Set to `false` to disable +markComment: > + This issue has been automatically marked as stale because it has not had + recent activity. If this is still an issue, please add a comment. It will be closed if no further activity occurs. Thank you + for your contributions. +# Comment to post when closing a stale issue. Set to `false` to disable +closeComment: false From a50ffba3b15e2d268cc0e821274beb305fce5226 Mon Sep 17 00:00:00 2001 From: Steven Zeck <8315038+szeck87@users.noreply.github.com> Date: Fri, 3 Nov 2017 21:20:36 -0500 Subject: [PATCH 02/49] Update readme and troubleshooting (#1929) Add downloads badge, add link to contributing to readme. Add common issues section in troubleshooting --- README-template.md | 3 +++ README.md | 3 +++ docs/troubleshooting.md | 6 ++++++ 3 files changed, 12 insertions(+) diff --git a/README-template.md b/README-template.md index 1726007..911743d 100644 --- a/README-template.md +++ b/README-template.md @@ -1,4 +1,5 @@ # :lipstick: [{{package.name}}](https://github.com/Glavin001/atom-beautify) +[![apm](https://img.shields.io/apm/dm/atom-beautify.svg)](https://atom.io/packages/atom-beautify) [![Greenkeeper badge](https://badges.greenkeeper.io/Glavin001/atom-beautify.svg)](https://greenkeeper.io/) [![GitHub issues](https://img.shields.io/github/issues/Glavin001/atom-beautify.svg?style=flat-square)](https://github.com/Glavin001/atom-beautify/issues) [![GitHub stars](https://img.shields.io/github/stars/Glavin001/atom-beautify.svg?style=flat-square)](https://github.com/Glavin001/atom-beautify/stargazers) @@ -203,6 +204,8 @@ See [`docs/troubleshooting.md`](docs/troubleshooting.md). ## Contributing +See [`CONTRIBUTING.md`](CONTRIBUTING.md). + [See all contributors on GitHub](../../graphs/contributors). Please update the [CHANGELOG.md](CHANGELOG.md), diff --git a/README.md b/README.md index ee00544..c47e015 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,5 @@ # :lipstick: [atom-beautify](https://github.com/Glavin001/atom-beautify) +[![apm](https://img.shields.io/apm/dm/atom-beautify.svg)](https://atom.io/packages/atom-beautify) [![Greenkeeper badge](https://badges.greenkeeper.io/Glavin001/atom-beautify.svg)](https://greenkeeper.io/) [![GitHub issues](https://img.shields.io/github/issues/Glavin001/atom-beautify.svg?style=flat-square)](https://github.com/Glavin001/atom-beautify/issues) [![GitHub stars](https://img.shields.io/github/stars/Glavin001/atom-beautify.svg?style=flat-square)](https://github.com/Glavin001/atom-beautify/stargazers) @@ -318,6 +319,8 @@ See [`docs/troubleshooting.md`](docs/troubleshooting.md). ## Contributing +See [`CONTRIBUTING.md`](CONTRIBUTING.md). + [See all contributors on GitHub](../../graphs/contributors). Please update the [CHANGELOG.md](CHANGELOG.md), diff --git a/docs/troubleshooting.md b/docs/troubleshooting.md index df99d73..b01f828 100644 --- a/docs/troubleshooting.md +++ b/docs/troubleshooting.md @@ -16,3 +16,9 @@ The debugging results will be copied to your clipboard. 3. Create a file in your new Gist called `debug.md`. 4. Paste your debugging results from Atom beautify into `debug.md` file in your Gist. 5. Add a link to your Gist in your new Issue. + +## Common Issues + +> I receive an error when I try to install or update Atom Beautify + +Run `apm clean` from your terminal, then retry \ No newline at end of file From 3dd3a2b9e9f8b2f588c28e66e100171c94da3364 Mon Sep 17 00:00:00 2001 From: Steven Zeck <8315038+szeck87@users.noreply.github.com> Date: Fri, 3 Nov 2017 21:59:36 -0500 Subject: [PATCH 03/49] Update to exclude add language and beautifier --- .github/stale.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/stale.yml b/.github/stale.yml index 32e4a6b..f951363 100644 --- a/.github/stale.yml +++ b/.github/stale.yml @@ -6,6 +6,8 @@ daysUntilClose: 7 exemptLabels: - high priority - pending-publication + - add-language + - add-beautifier # Label to use when marking an issue as stale staleLabel: stale # Comment to post when marking an issue as stale. Set to `false` to disable From b3c9c3c2ab6d8744da3eb0a6fbfa6e245d27aba6 Mon Sep 17 00:00:00 2001 From: Steven Zeck Date: Sat, 11 Nov 2017 13:45:30 -0600 Subject: [PATCH 04/49] Add support for ocp-indent as an executable and Docker image docs --- README.md | 2 +- docs/options.md | 17 +++++++++++++++++ src/beautifiers/ocp-indent.coffee | 21 +++++++++++++++++++-- src/options.json | 16 ++++++++++++++++ 4 files changed, 53 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index c47e015..a29dd9f 100644 --- a/README.md +++ b/README.md @@ -97,7 +97,7 @@ Some of the supported beautifiers are developed for Node.js and are automaticall | Lua beautifier | :white_check_mark: | :ok_hand: Not necessary | :smiley: Nothing! | | Marko Beautifier | :white_check_mark: | :ok_hand: Not necessary | :smiley: Nothing! | | Nginx Beautify | :white_check_mark: | :ok_hand: Not necessary | :smiley: Nothing! | -| ocp-indent | :warning: Manual installation | :construction: Not an executable | :page_facing_up: Go to https://www.typerex.org/ocp-indent.html and follow the instructions. | +| ocp-indent | :warning: 1 executable | :white_check_mark: :100:% of executables | :whale: With [Docker](https://www.docker.com/):
1. Install [ocp-indent (`ocp-indent`)](https://www.typerex.org/ocp-indent.html) with `docker pull unibeautify/ocp-indent`

:bookmark_tabs: Manually:
1. Install [ocp-indent (`ocp-indent`)](https://www.typerex.org/ocp-indent.html) by following https://www.typerex.org/ocp-indent.html#installation
| | Perltidy | :warning: Manual installation | :construction: Not an executable | :page_facing_up: Go to http://perltidy.sourceforge.net/ and follow the instructions. | | PHP-CS-Fixer | :warning: 2 executables | :warning: Only 1 of 2 executables | :whale: With [Docker](https://www.docker.com/):
1. Install [PHP-CS-Fixer (`php-cs-fixer`)](https://github.com/FriendsOfPHP/PHP-CS-Fixer) with `docker pull unibeautify/php-cs-fixer`

:bookmark_tabs: Manually:
1. Install [PHP (`php`)](http://php.net/) by following http://php.net/manual/en/install.php
2. Install [PHP-CS-Fixer (`php-cs-fixer`)](https://github.com/FriendsOfPHP/PHP-CS-Fixer) by following https://github.com/FriendsOfPHP/PHP-CS-Fixer#installation
| | PHPCBF | :warning: 2 executables | :warning: Only 1 of 2 executables | :whale: With [Docker](https://www.docker.com/):
1. Install [PHPCBF (`phpcbf`)](https://github.com/squizlabs/PHP_CodeSniffer) with `docker pull unibeautify/phpcbf`

:bookmark_tabs: Manually:
1. Install [PHP (`php`)](http://php.net/) by following http://php.net/manual/en/install.php
2. Install [PHPCBF (`phpcbf`)](https://github.com/squizlabs/PHP_CodeSniffer) by following https://github.com/squizlabs/PHP_CodeSniffer#installation
| diff --git a/docs/options.md b/docs/options.md index 7f3311d..e385be6 100644 --- a/docs/options.md +++ b/docs/options.md @@ -283,6 +283,23 @@ Options for isort executable. 2. Go into *Packages* and search for "*Atom Beautify*" package. 3. Find the option "*isort*" and change it to your desired configuration. +##### [ocp-indent](#ocp-indent) + +**Important**: This option is only configurable from within Atom Beautify's setting panel. + +**Type**: `object` + +**Description**: + +Options for ocp-indent executable. + +**How to Configure** + +1. You can open the [Settings View](https://github.com/atom/settings-view) by navigating to +*Edit > Preferences (Linux)*, *Atom > Preferences (OS X)*, or *File > Preferences (Windows)*. +2. Go into *Packages* and search for "*Atom Beautify*" package. +3. Find the option "*ocp-indent*" and change it to your desired configuration. + ##### [PHP](#php) **Important**: This option is only configurable from within Atom Beautify's setting panel. diff --git a/src/beautifiers/ocp-indent.coffee b/src/beautifiers/ocp-indent.coffee index 22c0463..49c6c55 100644 --- a/src/beautifiers/ocp-indent.coffee +++ b/src/beautifiers/ocp-indent.coffee @@ -8,7 +8,24 @@ Beautifier = require('./beautifier') module.exports = class OCPIndent extends Beautifier name: "ocp-indent" link: "https://www.typerex.org/ocp-indent.html" - isPreInstalled: false + executables: [ + { + name: "ocp-indent" + cmd: "ocp-indent" + homepage: "https://www.typerex.org/ocp-indent.html" + installation: "https://www.typerex.org/ocp-indent.html#installation" + version: { + parse: (text) -> + try + text.match(/version (\d+\.\d+\.\d+)/)[1] + catch + text.match(/version (\d+\.\d+)/)[1] + ".0" + } + docker: { + image: "unibeautify/ocp-indent" + } + } + ] options: { OCaml: true @@ -21,4 +38,4 @@ module.exports = class OCPIndent extends Beautifier help: { link: "https://www.typerex.org/ocp-indent.html" } - }) + }) \ No newline at end of file diff --git a/src/options.json b/src/options.json index 0eca25e..604a477 100644 --- a/src/options.json +++ b/src/options.json @@ -9320,6 +9320,22 @@ } } }, + "ocp-indent": { + "key": "ocp-indent", + "title": "ocp-indent", + "type": "object", + "collapsed": true, + "description": "Options for ocp-indent executable.", + "properties": { + "path": { + "key": "path", + "title": "Binary/Script Path", + "type": "string", + "default": "", + "description": "Absolute path to the \"ocp-indent\" executable's binary/script." + } + } + }, "php": { "key": "php", "title": "PHP", From f079330f8031fefa4c9aff0b07fec3cc6c202713 Mon Sep 17 00:00:00 2001 From: Steven Zeck Date: Sat, 11 Nov 2017 13:46:13 -0600 Subject: [PATCH 05/49] Update changelog --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6e79819..2598c19 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,5 @@ # Next -- ... +- Fix [#1862](https://github.com/Glavin001/atom-beautify/issues/1862) Add support for ocp-indent as an executable # v0.30.6 (2017-10-30) - See [#645](https://github.com/Glavin001/atom-beautify/issues/645). Add support for Terraform fmt. From 9db06679431c1fde71c5e0559578385c4a8fec12 Mon Sep 17 00:00:00 2001 From: Steven Zeck Date: Sat, 11 Nov 2017 13:47:20 -0600 Subject: [PATCH 06/49] Fix unit test error --- src/beautifiers/ocp-indent.coffee | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/beautifiers/ocp-indent.coffee b/src/beautifiers/ocp-indent.coffee index 49c6c55..7c196de 100644 --- a/src/beautifiers/ocp-indent.coffee +++ b/src/beautifiers/ocp-indent.coffee @@ -17,9 +17,9 @@ module.exports = class OCPIndent extends Beautifier version: { parse: (text) -> try - text.match(/version (\d+\.\d+\.\d+)/)[1] + text.match(/(\d+\.\d+\.\d+)/)[1] catch - text.match(/version (\d+\.\d+)/)[1] + ".0" + text.match(/(\d+\.\d+)/)[1] + ".0" } docker: { image: "unibeautify/ocp-indent" From a5c5d339a56dc356e9e86b59df0cf627954e02f4 Mon Sep 17 00:00:00 2001 From: Steven Zeck Date: Tue, 21 Nov 2017 21:08:06 -0600 Subject: [PATCH 07/49] Refactor handleSaveEvent to use onWillSave async (#1924) * Update handleSaveEvent to use onWillSave and refactor * Remove old handleSaveEvent function * Specify minimum version of Atom of 1.21.0 --- package.json | 2 +- src/beautify.coffee | 29 +++++++---------------------- 2 files changed, 8 insertions(+), 23 deletions(-) diff --git a/package.json b/package.json index 394f8ce..7ea09f2 100644 --- a/package.json +++ b/package.json @@ -153,7 +153,7 @@ } ], "engines": { - "atom": ">=1.6.0 <2.0.0" + "atom": ">=1.21.0 <2.0.0" }, "dependencies": { "align-yaml": "^0.1.8", diff --git a/src/beautify.coffee b/src/beautify.coffee index 3a850a4..9b9aba9 100644 --- a/src/beautify.coffee +++ b/src/beautify.coffee @@ -506,20 +506,17 @@ debug = () -> handleSaveEvent = -> atom.workspace.observeTextEditors (editor) -> - pendingPaths = {} beautifyOnSaveHandler = ({path: filePath}) -> - logger.verbose('Should beautify on this save?') - if pendingPaths[filePath] - logger.verbose("Editor with file path #{filePath} already beautified!") - return - buffer = editor.getBuffer() path ?= require('path') - # Get Grammar - grammar = editor.getGrammar().name # Get file extension fileExtension = path.extname(filePath) # Remove prefix "." (period) in fileExtension fileExtension = fileExtension.substr(1) + # Set path of buffer for unsaved files + if editor.getPath() is undefined + editor.getBuffer().setPath(filePath) + # Get Grammar from the editor + grammar = editor.getGrammar().name # Get language languages = beautifier.languages.getLanguages({grammar, extension: fileExtension}) if languages.length < 1 @@ -535,23 +532,11 @@ handleSaveEvent = -> beautify({editor, onSave: true}) .then(() -> logger.verbose('Done beautifying file', filePath) - if editor.isAlive() is true - logger.verbose('Saving TextEditor...') - # Store the filePath to prevent infinite looping - # When Whitespace package has option "Ensure Single Trailing Newline" enabled - # It will add a newline and keep the file from converging on a beautified form - # and saving without emitting onDidSave event, because there were no changes. - pendingPaths[filePath] = true - Promise.resolve(editor.save()).then(() -> - delete pendingPaths[filePath] - logger.verbose('Saved TextEditor.') - ) ) .catch((error) -> return showError(error) ) - disposable = editor.onDidSave(({path : filePath}) -> - # TODO: Implement debouncing + disposable = editor.getBuffer().onWillSave(({path: filePath}) -> beautifyOnSaveHandler({path: filePath}) ) plugin.subscriptions.add disposable @@ -632,4 +617,4 @@ plugin.activate = -> @addLanguageCommands() plugin.deactivate = -> - @subscriptions.dispose() + @subscriptions.dispose() \ No newline at end of file From 159f6c1a132c30e2a93a59fd1637e9b07213a00f Mon Sep 17 00:00:00 2001 From: Glavin Wiechert Date: Tue, 21 Nov 2017 23:13:56 -0400 Subject: [PATCH 08/49] See #1895, #1924. Update CHANGELOG --- CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6e79819..b1c57e7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,9 @@ # Next - ... +# v0.30.7 (2017-11-21) +- Refactor handleSaveEvent to use onWillSave async ([#1924](https://github.com/Glavin001/atom-beautify/pull/1924), [#1895](https://github.com/Glavin001/atom-beautify/issues/1895)) + # v0.30.6 (2017-10-30) - See [#645](https://github.com/Glavin001/atom-beautify/issues/645). Add support for Terraform fmt. - See [#881](https://github.com/Glavin001/atom-beautify/issues/881). Update to Prettydiff version 2! From 6043983c70b055215acd3029a385263a5b830fc6 Mon Sep 17 00:00:00 2001 From: Glavin Wiechert Date: Tue, 21 Nov 2017 23:14:53 -0400 Subject: [PATCH 09/49] 0.30.7 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 7ea09f2..fc48160 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "atom-beautify", "main": "./src/beautify", - "version": "0.30.6", + "version": "0.30.7", "private": true, "description": "Beautify HTML, CSS, JavaScript, PHP, Python, Ruby, Java, C, C++, C#, Objective-C, CoffeeScript, TypeScript, Coldfusion, SQL, and more in Atom", "repository": { From 8eee55bf2d62afb4f9f6a7e59c4a15bea7f56a27 Mon Sep 17 00:00:00 2001 From: Glavin Wiechert Date: Tue, 21 Nov 2017 23:15:30 -0400 Subject: [PATCH 10/49] Revert to v0.30.6 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index fc48160..7ea09f2 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "atom-beautify", "main": "./src/beautify", - "version": "0.30.7", + "version": "0.30.6", "private": true, "description": "Beautify HTML, CSS, JavaScript, PHP, Python, Ruby, Java, C, C++, C#, Objective-C, CoffeeScript, TypeScript, Coldfusion, SQL, and more in Atom", "repository": { From 2c87c50f2fc0d4c455352d5729cc733086d18ff0 Mon Sep 17 00:00:00 2001 From: Glavin Wiechert Date: Tue, 21 Nov 2017 23:15:42 -0400 Subject: [PATCH 11/49] Prepare 0.30.7 release --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 7ea09f2..fc48160 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "atom-beautify", "main": "./src/beautify", - "version": "0.30.6", + "version": "0.30.7", "private": true, "description": "Beautify HTML, CSS, JavaScript, PHP, Python, Ruby, Java, C, C++, C#, Objective-C, CoffeeScript, TypeScript, Coldfusion, SQL, and more in Atom", "repository": { From e167e6881a0053de44ab83457d833175e92b9fb1 Mon Sep 17 00:00:00 2001 From: Glavin Wiechert Date: Tue, 21 Nov 2017 23:20:49 -0400 Subject: [PATCH 12/49] Revert to v0.30.6 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index fc48160..7ea09f2 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "atom-beautify", "main": "./src/beautify", - "version": "0.30.7", + "version": "0.30.6", "private": true, "description": "Beautify HTML, CSS, JavaScript, PHP, Python, Ruby, Java, C, C++, C#, Objective-C, CoffeeScript, TypeScript, Coldfusion, SQL, and more in Atom", "repository": { From 2690d2665b0ace3b836b6a0628fa34914d5b70c3 Mon Sep 17 00:00:00 2001 From: Glavin Wiechert Date: Tue, 21 Nov 2017 23:20:57 -0400 Subject: [PATCH 13/49] Prepare 0.30.7 release --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 7ea09f2..fc48160 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "atom-beautify", "main": "./src/beautify", - "version": "0.30.6", + "version": "0.30.7", "private": true, "description": "Beautify HTML, CSS, JavaScript, PHP, Python, Ruby, Java, C, C++, C#, Objective-C, CoffeeScript, TypeScript, Coldfusion, SQL, and more in Atom", "repository": { From 63c50ec7b3c4e9b006c2bae9ff5d2664c0325b62 Mon Sep 17 00:00:00 2001 From: Glavin Wiechert Date: Wed, 22 Nov 2017 09:56:43 -0400 Subject: [PATCH 14/49] Fix #1948, #1949. Fix beautify on save when text has not changed --- src/beautify.coffee | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/beautify.coffee b/src/beautify.coffee index 9b9aba9..bae3f81 100644 --- a/src/beautify.coffee +++ b/src/beautify.coffee @@ -135,7 +135,7 @@ beautify = ({ editor, onSave, language }) -> else error = new Error("Unsupported beautification result '#{text}'.") showError(error) - return reject(error) + return setTimeout(-> resolve(text), 0) # else # console.log "Already Beautiful!" From ab208351dd4a7ebc810acc19062d9583bf930f2b Mon Sep 17 00:00:00 2001 From: Glavin Wiechert Date: Wed, 22 Nov 2017 09:58:26 -0400 Subject: [PATCH 15/49] #1948, #1949. Update CHANGELOG --- CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index b1c57e7..08a4359 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,9 @@ # Next - ... +# v0.30.8 (2017-11-22) +- Fix [#1949](https://github.com/Glavin001/atom-beautify/issues/1949): Fix beautify on save when text has not changed. + # v0.30.7 (2017-11-21) - Refactor handleSaveEvent to use onWillSave async ([#1924](https://github.com/Glavin001/atom-beautify/pull/1924), [#1895](https://github.com/Glavin001/atom-beautify/issues/1895)) From 56d1f48bada8e38519701044da3d43d9c9489920 Mon Sep 17 00:00:00 2001 From: Glavin Wiechert Date: Wed, 22 Nov 2017 09:58:33 -0400 Subject: [PATCH 16/49] Prepare 0.30.8 release --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index fc48160..49ae598 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "atom-beautify", "main": "./src/beautify", - "version": "0.30.7", + "version": "0.30.8", "private": true, "description": "Beautify HTML, CSS, JavaScript, PHP, Python, Ruby, Java, C, C++, C#, Objective-C, CoffeeScript, TypeScript, Coldfusion, SQL, and more in Atom", "repository": { From fafd8c2991a78610e05587dfa7d5862a2451a827 Mon Sep 17 00:00:00 2001 From: Glavin Wiechert Date: Wed, 22 Nov 2017 09:59:03 -0400 Subject: [PATCH 17/49] Prepare 0.30.9 release --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 49ae598..c8c62a3 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "atom-beautify", "main": "./src/beautify", - "version": "0.30.8", + "version": "0.30.9", "private": true, "description": "Beautify HTML, CSS, JavaScript, PHP, Python, Ruby, Java, C, C++, C#, Objective-C, CoffeeScript, TypeScript, Coldfusion, SQL, and more in Atom", "repository": { From 5e8ee37b07e8152270d7d0f43fa9d6ebdd64add5 Mon Sep 17 00:00:00 2001 From: Glavin Wiechert Date: Wed, 22 Nov 2017 10:00:29 -0400 Subject: [PATCH 18/49] Prepare 0.30.10 release --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index c8c62a3..7b20c1d 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "atom-beautify", "main": "./src/beautify", - "version": "0.30.9", + "version": "0.30.10", "private": true, "description": "Beautify HTML, CSS, JavaScript, PHP, Python, Ruby, Java, C, C++, C#, Objective-C, CoffeeScript, TypeScript, Coldfusion, SQL, and more in Atom", "repository": { From b806475d9f7756f78911af7b2fcce316a8d937f8 Mon Sep 17 00:00:00 2001 From: Glavin Wiechert Date: Wed, 22 Nov 2017 10:03:36 -0400 Subject: [PATCH 19/49] Prepare 0.30.11 release --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 7b20c1d..81ef630 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "atom-beautify", "main": "./src/beautify", - "version": "0.30.10", + "version": "0.30.11", "private": true, "description": "Beautify HTML, CSS, JavaScript, PHP, Python, Ruby, Java, C, C++, C#, Objective-C, CoffeeScript, TypeScript, Coldfusion, SQL, and more in Atom", "repository": { From 948671fe8a49d505f246ffe6a798ffc619d1ab28 Mon Sep 17 00:00:00 2001 From: Glavin Wiechert Date: Wed, 22 Nov 2017 10:07:25 -0400 Subject: [PATCH 20/49] Prepare 0.30.12 release --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 81ef630..81b677f 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "atom-beautify", "main": "./src/beautify", - "version": "0.30.11", + "version": "0.30.12", "private": true, "description": "Beautify HTML, CSS, JavaScript, PHP, Python, Ruby, Java, C, C++, C#, Objective-C, CoffeeScript, TypeScript, Coldfusion, SQL, and more in Atom", "repository": { From 386924e59fd2237f5c10fcda5f31ecbd8d2285fb Mon Sep 17 00:00:00 2001 From: Glavin Wiechert Date: Wed, 22 Nov 2017 10:11:31 -0400 Subject: [PATCH 21/49] Revert to v0.30.7 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 81b677f..fc48160 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "atom-beautify", "main": "./src/beautify", - "version": "0.30.12", + "version": "0.30.7", "private": true, "description": "Beautify HTML, CSS, JavaScript, PHP, Python, Ruby, Java, C, C++, C#, Objective-C, CoffeeScript, TypeScript, Coldfusion, SQL, and more in Atom", "repository": { From ffc94e92baeaeb52000a9ca9163a3ce4c5ad3209 Mon Sep 17 00:00:00 2001 From: Glavin Wiechert Date: Wed, 22 Nov 2017 10:11:40 -0400 Subject: [PATCH 22/49] Prepare 0.30.8 release --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index fc48160..49ae598 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "atom-beautify", "main": "./src/beautify", - "version": "0.30.7", + "version": "0.30.8", "private": true, "description": "Beautify HTML, CSS, JavaScript, PHP, Python, Ruby, Java, C, C++, C#, Objective-C, CoffeeScript, TypeScript, Coldfusion, SQL, and more in Atom", "repository": { From ef35eec706a2c74bddfa84fe558c6df5879e7316 Mon Sep 17 00:00:00 2001 From: Glavin Wiechert Date: Wed, 22 Nov 2017 10:12:58 -0400 Subject: [PATCH 23/49] Prepare 0.30.9 release --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 49ae598..c8c62a3 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "atom-beautify", "main": "./src/beautify", - "version": "0.30.8", + "version": "0.30.9", "private": true, "description": "Beautify HTML, CSS, JavaScript, PHP, Python, Ruby, Java, C, C++, C#, Objective-C, CoffeeScript, TypeScript, Coldfusion, SQL, and more in Atom", "repository": { From b86c2bec483a522e7767751b6eaacf69c0a0c2fa Mon Sep 17 00:00:00 2001 From: Glavin Wiechert Date: Wed, 22 Nov 2017 10:17:11 -0400 Subject: [PATCH 24/49] Revert to v0.30.7 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index c8c62a3..fc48160 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "atom-beautify", "main": "./src/beautify", - "version": "0.30.9", + "version": "0.30.7", "private": true, "description": "Beautify HTML, CSS, JavaScript, PHP, Python, Ruby, Java, C, C++, C#, Objective-C, CoffeeScript, TypeScript, Coldfusion, SQL, and more in Atom", "repository": { From 1b223e3e4c6cd1c1d3f6e7f88e9f45411e9b30e2 Mon Sep 17 00:00:00 2001 From: Glavin Wiechert Date: Wed, 22 Nov 2017 10:17:21 -0400 Subject: [PATCH 25/49] Prepare 0.30.8 release --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index fc48160..49ae598 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "atom-beautify", "main": "./src/beautify", - "version": "0.30.7", + "version": "0.30.8", "private": true, "description": "Beautify HTML, CSS, JavaScript, PHP, Python, Ruby, Java, C, C++, C#, Objective-C, CoffeeScript, TypeScript, Coldfusion, SQL, and more in Atom", "repository": { From 6713d20780e8e9c7155085152aa184d2883d04b5 Mon Sep 17 00:00:00 2001 From: Glavin Wiechert Date: Wed, 22 Nov 2017 10:35:44 -0400 Subject: [PATCH 26/49] Prepare 0.30.8 release --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index fc48160..49ae598 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "atom-beautify", "main": "./src/beautify", - "version": "0.30.7", + "version": "0.30.8", "private": true, "description": "Beautify HTML, CSS, JavaScript, PHP, Python, Ruby, Java, C, C++, C#, Objective-C, CoffeeScript, TypeScript, Coldfusion, SQL, and more in Atom", "repository": { From c6760ef3fea927d0e996bf2aaa201e4c73f46f38 Mon Sep 17 00:00:00 2001 From: Glavin Wiechert Date: Wed, 22 Nov 2017 10:50:47 -0400 Subject: [PATCH 27/49] Fix #1948, #1949. Fix beautify on save when text has not changed --- CHANGELOG.md | 3 +++ src/beautify.coffee | 10 +++++++--- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 08a4359..a674ec3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,9 @@ # Next - ... +# v0.30.9 (2017-11-22) +- Fix [#1949](https://github.com/Glavin001/atom-beautify/issues/1949): Fix beautify on save when text has not changed. + # v0.30.8 (2017-11-22) - Fix [#1949](https://github.com/Glavin001/atom-beautify/issues/1949): Fix beautify on save when text has not changed. diff --git a/src/beautify.coffee b/src/beautify.coffee index bae3f81..af517ec 100644 --- a/src/beautify.coffee +++ b/src/beautify.coffee @@ -96,9 +96,10 @@ beautify = ({ editor, onSave, language }) -> if not text? # Do nothing, is undefined # console.log 'beautifyCompleted' + return resolve(text) else if text instanceof Error showError(text) - return reject(text) + return resolve(text) else if typeof text is "string" if oldText isnt text @@ -127,15 +128,18 @@ beautify = ({ editor, onSave, language }) -> # otherwise setScrollTop is not working, probably because the cursor # addition happens asynchronously setTimeout ( -> - # console.log "setScrollTop" setScrollTop editor, origScrollTop return resolve(text) ), 0 + else + return setTimeout(() -> + resolve(text) + , 0) else error = new Error("Unsupported beautification result '#{text}'.") showError(error) - return setTimeout(-> resolve(text), 0) + return resolve(text) # else # console.log "Already Beautiful!" From 03c2a03cb18d6b89bf76abeb40fa5dfe23ea34bf Mon Sep 17 00:00:00 2001 From: Glavin Wiechert Date: Wed, 22 Nov 2017 10:51:59 -0400 Subject: [PATCH 28/49] Change repository to using git instead of https --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 49ae598..c27bd1f 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,7 @@ "description": "Beautify HTML, CSS, JavaScript, PHP, Python, Ruby, Java, C, C++, C#, Objective-C, CoffeeScript, TypeScript, Coldfusion, SQL, and more in Atom", "repository": { "type": "git", - "url": "https://github.com/Glavin001/atom-beautify" + "url": "git@github.com:Glavin001/atom-beautify.git" }, "bugs": { "url": "https://github.com/Glavin001/atom-beautify/issues" From 0ba7fc58175f3b3b7e3701e8b286cdaaa1169c5c Mon Sep 17 00:00:00 2001 From: Glavin Wiechert Date: Wed, 22 Nov 2017 10:52:23 -0400 Subject: [PATCH 29/49] Prepare 0.30.9 release --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index c27bd1f..8898cdd 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "atom-beautify", "main": "./src/beautify", - "version": "0.30.8", + "version": "0.30.9", "private": true, "description": "Beautify HTML, CSS, JavaScript, PHP, Python, Ruby, Java, C, C++, C#, Objective-C, CoffeeScript, TypeScript, Coldfusion, SQL, and more in Atom", "repository": { From 1659aa8ec0eb469fe9e39e858d22233159476ff9 Mon Sep 17 00:00:00 2001 From: Steven Zeck Date: Fri, 15 Dec 2017 23:12:58 -0600 Subject: [PATCH 30/49] Add ensurepip flag for Travis build issues --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index 0b2e4ca..6cd3b4f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -88,6 +88,7 @@ cache: before_install: # Install Homebrew on Linux + - python -m ensurepip - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then git clone --depth=1 https://github.com/Linuxbrew/brew.git ~/.linuxbrew || true; fi From 8722279281184c7656d18163268ca86c09c99a93 Mon Sep 17 00:00:00 2001 From: Steven Zeck Date: Fri, 15 Dec 2017 23:19:35 -0600 Subject: [PATCH 31/49] Revert addition of ensurepip --- .travis.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 6cd3b4f..0b2e4ca 100644 --- a/.travis.yml +++ b/.travis.yml @@ -88,7 +88,6 @@ cache: before_install: # Install Homebrew on Linux - - python -m ensurepip - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then git clone --depth=1 https://github.com/Linuxbrew/brew.git ~/.linuxbrew || true; fi From cae8a76651a5f4942dc4fda5d3726febe0a7984e Mon Sep 17 00:00:00 2001 From: Glavin Wiechert Date: Mon, 25 Dec 2017 04:54:49 -0400 Subject: [PATCH 32/49] Add poll about cloud service to README --- README.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/README.md b/README.md index c47e015..014a00d 100644 --- a/README.md +++ b/README.md @@ -65,6 +65,18 @@ Thank you. Atom-Beautify is going to be completely rewritten with [Unibeautify](https://github.com/Unibeautify/unibeautify) at its core! See [`unibeautify` branch](../../tree/unibeautify) for work in progress and [Issue #1174](https://github.com/Glavin001/atom-beautify/issues/1174). +### Poll: Improving installation of third-party beautifiers + +Many users are experiencing issues when installing third party beautifiers (e.g. Uncrustify, PHP-CS-Fixer, and many more). +A possible solution is a "cloud" service which provides remote access to these beautifiers. Atom-Beautify would then communicate with these services, allowing for zero-installation beautification. + +Please let us know what you think! + +[![](https://m131jyck4m.execute-api.us-west-2.amazonaws.com/prod/poll/01BY57P9ACSDQASVT7KYZKZESK/Yes%2C%20cloud%20solution%20would%20be%20great!)](https://m131jyck4m.execute-api.us-west-2.amazonaws.com/prod/poll/01BY57P9ACSDQASVT7KYZKZESK/Yes%2C%20cloud%20solution%20would%20be%20great!/vote) +[![](https://m131jyck4m.execute-api.us-west-2.amazonaws.com/prod/poll/01BY57P9ACSDQASVT7KYZKZESK/No%2C%20I%20enjoy%20manually%20installing%20beautifiers)](https://m131jyck4m.execute-api.us-west-2.amazonaws.com/prod/poll/01BY57P9ACSDQASVT7KYZKZESK/No%2C%20I%20enjoy%20manually%20installing%20beautifiers/vote) +[![](https://m131jyck4m.execute-api.us-west-2.amazonaws.com/prod/poll/01BY57P9ACSDQASVT7KYZKZESK/No%2C%20I%20am%20happy%20using%20Docker)](https://m131jyck4m.execute-api.us-west-2.amazonaws.com/prod/poll/01BY57P9ACSDQASVT7KYZKZESK/No%2C%20I%20am%20happy%20using%20Docker/vote) +[![](https://m131jyck4m.execute-api.us-west-2.amazonaws.com/prod/poll/01BY57P9ACSDQASVT7KYZKZESK/No%2C%20I%20do%20not%20want%20to%20send%20me%20code%20over%20the%20Internet)](https://m131jyck4m.execute-api.us-west-2.amazonaws.com/prod/poll/01BY57P9ACSDQASVT7KYZKZESK/No%2C%20I%20do%20not%20want%20to%20send%20me%20code%20over%20the%20Internet/vote) + ## Beautifiers Some of the supported beautifiers are developed for Node.js and are automatically installed when Atom-Beautify is installed. However, other beautifiers are command-line interface (CLI) applications and require you to manually install them. From f201a0a026062b3c51b53788f98f657cccba7697 Mon Sep 17 00:00:00 2001 From: Glavin Wiechert Date: Mon, 25 Dec 2017 04:55:19 -0400 Subject: [PATCH 33/49] Add poll about cloud service to README-template --- README-template.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/README-template.md b/README-template.md index 911743d..fa7e9c9 100644 --- a/README-template.md +++ b/README-template.md @@ -65,6 +65,18 @@ Thank you. Atom-Beautify is going to be completely rewritten with [Unibeautify](https://github.com/Unibeautify/unibeautify) at its core! See [`unibeautify` branch](../../tree/unibeautify) for work in progress and [Issue #1174](https://github.com/Glavin001/atom-beautify/issues/1174). +### Poll: Improving installation of third-party beautifiers + +Many users are experiencing issues when installing third party beautifiers (e.g. Uncrustify, PHP-CS-Fixer, and many more). +A possible solution is a "cloud" service which provides remote access to these beautifiers. Atom-Beautify would then communicate with these services, allowing for zero-installation beautification. + +Please let us know what you think! + +[![](https://m131jyck4m.execute-api.us-west-2.amazonaws.com/prod/poll/01BY57P9ACSDQASVT7KYZKZESK/Yes%2C%20cloud%20solution%20would%20be%20great!)](https://m131jyck4m.execute-api.us-west-2.amazonaws.com/prod/poll/01BY57P9ACSDQASVT7KYZKZESK/Yes%2C%20cloud%20solution%20would%20be%20great!/vote) +[![](https://m131jyck4m.execute-api.us-west-2.amazonaws.com/prod/poll/01BY57P9ACSDQASVT7KYZKZESK/No%2C%20I%20enjoy%20manually%20installing%20beautifiers)](https://m131jyck4m.execute-api.us-west-2.amazonaws.com/prod/poll/01BY57P9ACSDQASVT7KYZKZESK/No%2C%20I%20enjoy%20manually%20installing%20beautifiers/vote) +[![](https://m131jyck4m.execute-api.us-west-2.amazonaws.com/prod/poll/01BY57P9ACSDQASVT7KYZKZESK/No%2C%20I%20am%20happy%20using%20Docker)](https://m131jyck4m.execute-api.us-west-2.amazonaws.com/prod/poll/01BY57P9ACSDQASVT7KYZKZESK/No%2C%20I%20am%20happy%20using%20Docker/vote) +[![](https://m131jyck4m.execute-api.us-west-2.amazonaws.com/prod/poll/01BY57P9ACSDQASVT7KYZKZESK/No%2C%20I%20do%20not%20want%20to%20send%20me%20code%20over%20the%20Internet)](https://m131jyck4m.execute-api.us-west-2.amazonaws.com/prod/poll/01BY57P9ACSDQASVT7KYZKZESK/No%2C%20I%20do%20not%20want%20to%20send%20me%20code%20over%20the%20Internet/vote) + ## Beautifiers Some of the supported beautifiers are developed for Node.js and are automatically installed when Atom-Beautify is installed. However, other beautifiers are command-line interface (CLI) applications and require you to manually install them. From 62cc0696121e694cb48d0d55052ca44e926767d6 Mon Sep 17 00:00:00 2001 From: Glavin Wiechert Date: Mon, 25 Dec 2017 06:06:03 -0400 Subject: [PATCH 34/49] Add link to questionnaire --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 014a00d..601c4b1 100644 --- a/README.md +++ b/README.md @@ -7,6 +7,8 @@ [![Bountysource](https://img.shields.io/bountysource/team/atom-beautify/activity.svg?style=flat-square)](https://www.bountysource.com/teams/atom-beautify) [![Paypal Donations](https://www.paypalobjects.com/en_US/i/btn/btn_donate_SM.gif)](https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=X2RK5DKN6YXPJ&lc=CA&item_name=Atom%2dBeautify&item_number=atom%2dbeautify¤cy_code=CAD&bn=PP%2dDonationsBF%3abtn_donate_LG%2egif%3aNonHosted) +**Help improve Atom-Beautify by completing the questionnaire: [https://goo.gl/iEHBNr](https://goo.gl/iEHBNr)** + | Mac OS and | | | --- | --- | | [Travis CI: ![Build Status](https://travis-ci.org/Glavin001/atom-beautify.svg?branch=master)](https://travis-ci.org/Glavin001/atom-beautify) | [AppVeyor: ![Build status](https://ci.appveyor.com/api/projects/status/himnq7tjxl2fdc8u/branch/master?svg=true)](https://ci.appveyor.com/project/Glavin001/atom-beautify/branch/master) | From 8de12b97775ca33c8a2427af43445df647ede16e Mon Sep 17 00:00:00 2001 From: Glavin Wiechert Date: Mon, 25 Dec 2017 06:06:31 -0400 Subject: [PATCH 35/49] Add link to questionnaire to README-template --- README-template.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README-template.md b/README-template.md index fa7e9c9..bd514f3 100644 --- a/README-template.md +++ b/README-template.md @@ -7,6 +7,8 @@ [![Bountysource](https://img.shields.io/bountysource/team/atom-beautify/activity.svg?style=flat-square)](https://www.bountysource.com/teams/atom-beautify) [![Paypal Donations](https://www.paypalobjects.com/en_US/i/btn/btn_donate_SM.gif)](https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=X2RK5DKN6YXPJ&lc=CA&item_name=Atom%2dBeautify&item_number=atom%2dbeautify¤cy_code=CAD&bn=PP%2dDonationsBF%3abtn_donate_LG%2egif%3aNonHosted) +**Help improve Atom-Beautify by completing the questionnaire: [https://goo.gl/iEHBNr](https://goo.gl/iEHBNr)** + | Mac OS and | | | --- | --- | | [Travis CI: ![Build Status](https://travis-ci.org/Glavin001/atom-beautify.svg?branch=master)](https://travis-ci.org/Glavin001/atom-beautify) | [AppVeyor: ![Build status](https://ci.appveyor.com/api/projects/status/himnq7tjxl2fdc8u/branch/master?svg=true)](https://ci.appveyor.com/project/Glavin001/atom-beautify/branch/master) | From a60ba02a7a1c4a36dbd60fcf68cf8e93a7e17fdb Mon Sep 17 00:00:00 2001 From: Steven Zeck Date: Tue, 2 Jan 2018 23:32:49 -0600 Subject: [PATCH 36/49] Use pip2 for OSX, php 7.2 for Windows --- .travis.yml | 10 +++++----- appveyor.yml | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.travis.yml b/.travis.yml index 0b2e4ca..f12cc1e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -113,15 +113,15 @@ before_install: pip install --user --upgrade autopep8; pip install --user --upgrade isort; else - pip install --upgrade pip; - pip install --upgrade autopep8; - pip install --upgrade isort; + pip2 install --upgrade pip2; + pip2 install --upgrade autopep8; + pip2 install --upgrade isort; fi # SQL language support - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then pip install --user --upgrade sqlparse; else - pip install --upgrade sqlparse; + pip2 install --upgrade sqlparse; fi # Java, C, C++, C#, Objective-C, D, Pawn, Vala - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then @@ -184,7 +184,7 @@ before_install: - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then pip install --user beautysh; else - pip install beautysh; + pip2 install beautysh; fi # terraform - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then diff --git a/appveyor.yml b/appveyor.yml index bf21dfb..e3fb5d8 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -107,8 +107,8 @@ install: # PHP - ps: Set-Service wuauserv -StartupType Manual - cinst php -y - - ps: "ls \"C:\\tools\\php71\"" - - "SET PATH=C:\\tools\\php71;%PATH%" + - ps: "ls \"C:\\tools\\php72\"" + - "SET PATH=C:\\tools\\php72;%PATH%" - where php # PHP-CS-Fixer - cinst curl -y # Use cURL to download file from URL From 05669035fc9d80e13524d540baeb8315a7b94c05 Mon Sep 17 00:00:00 2001 From: Colin Hebert Date: Mon, 8 Jan 2018 12:06:06 +0100 Subject: [PATCH 37/49] Use docker image to run puppet-lint Use unibeautify/puppet-lint that provides puppet-lint in docker. --- src/beautifiers/puppet-fix.coffee | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/src/beautifiers/puppet-fix.coffee b/src/beautifiers/puppet-fix.coffee index 4ae96ed..cd01021 100644 --- a/src/beautifiers/puppet-fix.coffee +++ b/src/beautifiers/puppet-fix.coffee @@ -8,21 +8,28 @@ module.exports = class PuppetFix extends Beautifier # this is what displays as your Default Beautifier in Language Config name: "puppet-lint" link: "http://puppet-lint.com/" - isPreInstalled: false options: { Puppet: true } - cli: (options) -> - if not options.puppet_path? - return new Error("'puppet-lint' path is not set!" + - " Please set this in the Atom Beautify package settings.") - else - return options.puppet_path + executables: [ + { + name: "puppet-lint" + cmd: "puppet-lint" + homepage: "http://puppet-lint.com/" + installation: "http://puppet-lint.com/" + version: { + parse: (text) -> text.match(/puppet-lint (\d+\.\d+\.\d+)/)[1] + } + docker: { + image: "unibeautify/puppet-lint" + } + } + ] beautify: (text, language, options) -> - @run("puppet-lint", [ + @exe("puppet-lint", [ '--fix' tempFile = @tempFile("input", text) ], { From a0ae81f51965ac89d119da8fc2d91778e3d4b458 Mon Sep 17 00:00:00 2001 From: Colin Hebert Date: Mon, 8 Jan 2018 20:31:30 +0100 Subject: [PATCH 38/49] Run npm run docs --- README.md | 2 +- docs/options.md | 17 +++++++++++++++++ src/options.json | 16 ++++++++++++++++ 3 files changed, 34 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 601c4b1..c81cb1d 100644 --- a/README.md +++ b/README.md @@ -117,7 +117,7 @@ Some of the supported beautifiers are developed for Node.js and are automaticall | PHPCBF | :warning: 2 executables | :warning: Only 1 of 2 executables | :whale: With [Docker](https://www.docker.com/):
1. Install [PHPCBF (`phpcbf`)](https://github.com/squizlabs/PHP_CodeSniffer) with `docker pull unibeautify/phpcbf`

:bookmark_tabs: Manually:
1. Install [PHP (`php`)](http://php.net/) by following http://php.net/manual/en/install.php
2. Install [PHPCBF (`phpcbf`)](https://github.com/squizlabs/PHP_CodeSniffer) by following https://github.com/squizlabs/PHP_CodeSniffer#installation
| | Pretty Diff | :white_check_mark: | :ok_hand: Not necessary | :smiley: Nothing! | | Pug Beautify | :white_check_mark: | :ok_hand: Not necessary | :smiley: Nothing! | -| puppet-lint | :warning: Manual installation | :construction: Not an executable | :page_facing_up: Go to http://puppet-lint.com/ and follow the instructions. | +| puppet-lint | :warning: 1 executable | :white_check_mark: :100:% of executables | :whale: With [Docker](https://www.docker.com/):
1. Install [puppet-lint (`puppet-lint`)](http://puppet-lint.com/) with `docker pull unibeautify/puppet-lint`

:bookmark_tabs: Manually:
1. Install [puppet-lint (`puppet-lint`)](http://puppet-lint.com/) by following http://puppet-lint.com/
| | pybeautifier | :warning: Manual installation | :construction: Not an executable | :page_facing_up: Go to https://github.com/guyskk/pybeautifier and follow the instructions. | | Remark | :white_check_mark: | :ok_hand: Not necessary | :smiley: Nothing! | | Rubocop | :warning: Manual installation | :construction: Not an executable | :page_facing_up: Go to https://github.com/bbatsov/rubocop and follow the instructions. | diff --git a/docs/options.md b/docs/options.md index 7f3311d..273168a 100644 --- a/docs/options.md +++ b/docs/options.md @@ -334,6 +334,23 @@ Options for PHPCBF executable. 2. Go into *Packages* and search for "*Atom Beautify*" package. 3. Find the option "*PHPCBF*" and change it to your desired configuration. +##### [puppet-lint](#puppet-lint) + +**Important**: This option is only configurable from within Atom Beautify's setting panel. + +**Type**: `object` + +**Description**: + +Options for puppet-lint executable. + +**How to Configure** + +1. You can open the [Settings View](https://github.com/atom/settings-view) by navigating to +*Edit > Preferences (Linux)*, *Atom > Preferences (OS X)*, or *File > Preferences (Windows)*. +2. Go into *Packages* and search for "*Atom Beautify*" package. +3. Find the option "*puppet-lint*" and change it to your desired configuration. + ##### [Rscript](#rscript) **Important**: This option is only configurable from within Atom Beautify's setting panel. diff --git a/src/options.json b/src/options.json index 0eca25e..d82a0c8 100644 --- a/src/options.json +++ b/src/options.json @@ -9368,6 +9368,22 @@ } } }, + "puppet-lint": { + "key": "puppet-lint", + "title": "puppet-lint", + "type": "object", + "collapsed": true, + "description": "Options for puppet-lint executable.", + "properties": { + "path": { + "key": "path", + "title": "Binary/Script Path", + "type": "string", + "default": "", + "description": "Absolute path to the \"puppet-lint\" executable's binary/script." + } + } + }, "sass-convert": { "key": "sass-convert", "title": "SassConvert", From 999f57630fc0a14597ee7eb4aa0c855c9cd0a865 Mon Sep 17 00:00:00 2001 From: Colin Hebert Date: Mon, 8 Jan 2018 20:45:02 +0100 Subject: [PATCH 39/49] Fix exe.run notation --- src/beautifiers/puppet-fix.coffee | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/beautifiers/puppet-fix.coffee b/src/beautifiers/puppet-fix.coffee index cd01021..4a22325 100644 --- a/src/beautifiers/puppet-fix.coffee +++ b/src/beautifiers/puppet-fix.coffee @@ -29,7 +29,7 @@ module.exports = class PuppetFix extends Beautifier ] beautify: (text, language, options) -> - @exe("puppet-lint", [ + @exe("puppet-lint").run([ '--fix' tempFile = @tempFile("input", text) ], { From 2fb54ce7172069566fa3e6d9b284bacd9c7ae2cf Mon Sep 17 00:00:00 2001 From: Glavin Wiechert Date: Tue, 9 Jan 2018 14:55:53 -0400 Subject: [PATCH 40/49] Add Twitter badge --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 951a101..040ec4e 100644 --- a/README.md +++ b/README.md @@ -6,6 +6,7 @@ [![Gitter](https://img.shields.io/gitter/room/Glavin001/atom-beautify.svg?style=flat-square)](https://gitter.im/Glavin001/atom-beautify) [![Bountysource](https://img.shields.io/bountysource/team/atom-beautify/activity.svg?style=flat-square)](https://www.bountysource.com/teams/atom-beautify) [![Paypal Donations](https://www.paypalobjects.com/en_US/i/btn/btn_donate_SM.gif)](https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=X2RK5DKN6YXPJ&lc=CA&item_name=Atom%2dBeautify&item_number=atom%2dbeautify¤cy_code=CAD&bn=PP%2dDonationsBF%3abtn_donate_LG%2egif%3aNonHosted) +[![Twitter URL](https://img.shields.io/twitter/url/http/shields.io.svg?style=social)](https://twitter.com/unibeautify) **Help improve Atom-Beautify by completing the questionnaire: [https://goo.gl/iEHBNr](https://goo.gl/iEHBNr)** From 3a4f982bfe8f9f0e123f0039b182a882440db7d9 Mon Sep 17 00:00:00 2001 From: Glavin Wiechert Date: Tue, 9 Jan 2018 14:58:50 -0400 Subject: [PATCH 41/49] Add Twitter badge to README-template --- README-template.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README-template.md b/README-template.md index bd514f3..ec5ab35 100644 --- a/README-template.md +++ b/README-template.md @@ -6,6 +6,7 @@ [![Gitter](https://img.shields.io/gitter/room/Glavin001/atom-beautify.svg?style=flat-square)](https://gitter.im/Glavin001/atom-beautify) [![Bountysource](https://img.shields.io/bountysource/team/atom-beautify/activity.svg?style=flat-square)](https://www.bountysource.com/teams/atom-beautify) [![Paypal Donations](https://www.paypalobjects.com/en_US/i/btn/btn_donate_SM.gif)](https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=X2RK5DKN6YXPJ&lc=CA&item_name=Atom%2dBeautify&item_number=atom%2dbeautify¤cy_code=CAD&bn=PP%2dDonationsBF%3abtn_donate_LG%2egif%3aNonHosted) +[![Twitter URL](https://img.shields.io/twitter/url/http/shields.io.svg?style=social)](https://twitter.com/unibeautify) **Help improve Atom-Beautify by completing the questionnaire: [https://goo.gl/iEHBNr](https://goo.gl/iEHBNr)** From 615f4cff783e5f4a0aa05134cfe9a8d8ed4af10b Mon Sep 17 00:00:00 2001 From: Stephen Date: Fri, 5 Jan 2018 21:04:01 -0800 Subject: [PATCH 42/49] Cleanup build --- .travis.yml | 166 +++++++---------------------------- Brewfile | 12 +++ Gemfile | 6 ++ appveyor.yml | 123 +++----------------------- appveyor/install.ps1 | 180 -------------------------------------- appveyor/run_with_env.cmd | 47 ---------- atom-packages.txt | 9 ++ build-package.sh | 60 ++----------- composer.json | 5 ++ packages.config | 9 ++ requirements.txt | 4 + 11 files changed, 95 insertions(+), 526 deletions(-) create mode 100644 Brewfile create mode 100644 Gemfile delete mode 100644 appveyor/install.ps1 delete mode 100644 appveyor/run_with_env.cmd create mode 100644 atom-packages.txt create mode 100644 composer.json create mode 100644 packages.config create mode 100644 requirements.txt diff --git a/.travis.yml b/.travis.yml index f12cc1e..5da898d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -11,53 +11,22 @@ notifications: script: sh build-package.sh +cache: + timeout: 1000 + git: - depth: 10 + depth: 1 -php: - - '5.6' -python: - - '2.7' -go: - - release - -matrix: - include: - - os: linux - dist: trusty - sudo: required - services: - - docker - env: - - ATOM_CHANNEL=stable - - os: linux - dist: trusty - sudo: required - services: - - docker - env: - - ATOM_CHANNEL=beta - # - os: linux - # dist: trusty - # sudo: require - # env: - # - ATOM_CHANNEL=stable - # - os: linux - # dist: trusty - # sudo: require - # env: - # - ATOM_CHANNEL=beta - - os: osx - env: - - ATOM_CHANNEL=stable - # - os: osx - # env: - # - ATOM_CHANNEL=beta +os: + - linux + - osx +sudo: required env: global: - - APM_TEST_PACKAGES="language-marko language-html-swig language-svg language-d mavensmate-atom language-lua language-puppet fuse" - - PATH="/home/travis/gopath/bin:$HOME/.linuxbrew/bin:$PATH" + matrix: + - ATOM_SCRIPT_NAME=atom-beta APM_SCRIPT_NAME=apm-beta + - ATOM_SCRIPT_NAME=atom APM_SCRIPT_NAME=apm addons: apt: @@ -71,9 +40,7 @@ addons: - libgnome-keyring-dev - fakeroot - crystal - - ocaml - camlp4 - - opam - php5-cli - golang @@ -84,111 +51,38 @@ cache: - vendor/bundle # gems are installed here, https://docs.travis-ci.com/user/languages/ruby/#Dependency-Management - node_modules - $HOME/.atom - - $HOME/.stack + - $HOME/.opam before_install: - # Install Homebrew on Linux + # linux: Install Nix, Nix packages, upgrade pip, and install python packages + # osx: Update Homebrew, remove conflicting cask, brew bundle, symlink elm-format, + # upgrade pip, and install python packages - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then - git clone --depth=1 https://github.com/Linuxbrew/brew.git ~/.linuxbrew || true; + curl https://nixos.org/nix/install | sh && + . ~/.nix-profile/etc/profile.d/nix.sh && + nix-env -i uncrustify R elm-format terraform atom atom-beta opam && + pip install --upgrade pip && + pip install --user -r requirements.txt; + elif [[ "$TRAVIS_OS_NAME" == "osx" ]]; then + brew update && brew cask zap oclint && brew bundle && + ln -s /usr/local/bin/elm-format-0.17 /usr/local/bin/elm-format && + pip2 install --upgrade pip && + pip2 install -r requirements.txt; + else + echo Error:TRAVIS_OS_NAME && exit 1; fi - # Update Homebrew - - brew update - - brew tap homebrew/dupes - - brew tap homebrew/versions # Ruby language support - # - gem install ruby-beautify --verbose - # - gem install rubocop - - gem install htmlbeautifier - - gem install puppet-lint - # Sass language support - - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then - gem install sass; - else - docker pull unibeautify/sass-convert; - fi - # Python language support - - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then - sudo chmod 777 -R /opt/python; - pip install --upgrade pip; - pip install --user --upgrade autopep8; - pip install --user --upgrade isort; - else - pip2 install --upgrade pip2; - pip2 install --upgrade autopep8; - pip2 install --upgrade isort; - fi - # SQL language support - - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then - pip install --user --upgrade sqlparse; - else - pip2 install --upgrade sqlparse; - fi - # Java, C, C++, C#, Objective-C, D, Pawn, Vala - - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then - brew install uncrustify; - else - docker pull unibeautify/uncrustify; - fi + - bundle install # R - - brew tap homebrew/science - - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then - brew install r; - rscript --version; - else - docker pull unibeautify/rscript; - fi + - Rscript --version # PHP - - brew tap homebrew/homebrew-php - - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then - brew install php56 || true; - brew gist-logs php56 || true; - echo -e "\n[Phar]\nphar.readonly = Off\n" >> /usr/local/etc/php/5.6/php.ini; - brew install php-cs-fixer || true; - brew gist-logs php-cs-fixer || true; - fi - - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then - wget http://get.sensiolabs.org/php-cs-fixer.phar -O php-cs-fixer; - chmod a+x php-cs-fixer; - mv php-cs-fixer $HOME/.linuxbrew/bin/php-cs-fixer; - fi + - composer install # CoffeeScript - npm install coffee-formatter - # Haskell - # - brew install haskell-stack - # - stack setup - # - stack install stylish-haskell - # Elm - - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then - curl -L -o /tmp/elm-format.tgz - https://github.com/avh4/elm-format/releases/download/0.7.0-exp/elm-format-0.17-0.7.0-exp-mac-x64.tgz; - tar xvzf /tmp/elm-format.tgz -C /usr/local/bin; - fi - - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then - curl -L -o /tmp/elm-format.tgz https://github.com/avh4/elm-format/releases/download/0.7.0-exp/elm-format-0.17-0.7.0-exp-linux-x64.tgz; - tar xvzf /tmp/elm-format.tgz -C $HOME/.linuxbrew/bin; - fi # OCaml - - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then - brew install ocaml; - brew install opam; - fi - opam init --auto-setup # Init environment variables for opam - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then eval `opam config env`; fi - opam install --yes ocp-indent - # Crystal - - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew install crystal-lang; fi - # Bash - - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then - pip install --user beautysh; - else - pip2 install beautysh; - fi - # terraform - - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then - brew install terraform; - else - docker pull hashicorp/terraform; - fi diff --git a/Brewfile b/Brewfile new file mode 100644 index 0000000..486f415 --- /dev/null +++ b/Brewfile @@ -0,0 +1,12 @@ +tap 'homebrew/science' +tap 'homebrew/php' +tap 'caskroom/versions' +brew 'uncrustify' +brew 'r' +brew 'composer' +brew 'opam' +brew 'crystal-lang' +brew 'terraform' +brew 'elm-format' +cask 'atom' +cask 'atom-beta' diff --git a/Gemfile b/Gemfile new file mode 100644 index 0000000..4805589 --- /dev/null +++ b/Gemfile @@ -0,0 +1,6 @@ +source "https://rubygems.org" + +gem "rubocop" +gem "htmlbeautifier" +gem "puppet-lint" +gem "sass" diff --git a/appveyor.yml b/appveyor.yml index e3fb5d8..d82f7f6 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -10,136 +10,35 @@ environment: # /E:ON and /V:ON options are not enabled in the batch script intepreter # See: http://stackoverflow.com/a/13751649/163740 CMD_IN_ENV: "cmd /E:ON /V:ON /C .\\appveyor\\run_with_env.cmd" - - matrix: - - PYTHON: "C:\\Python27" - PYTHON_VERSION: "2.7.8" - PYTHON_ARCH: "32" - RUBY_VERSION: 23 - - # - PYTHON: "C:\\Python27-x64" - # PYTHON_VERSION: "2.7.8" - # PYTHON_ARCH: "64" - # - # - PYTHON: "C:\\Python33" - # PYTHON_VERSION: "3.3.5" - # PYTHON_ARCH: "32" - # - # - PYTHON: "C:\\Python33-x64" - # PYTHON_VERSION: "3.3.5" - # PYTHON_ARCH: "64" - # - # - PYTHON: "C:\\Python34" - # PYTHON_VERSION: "3.4.1" - # PYTHON_ARCH: "32" - # - # - PYTHON: "C:\\Python34-x64" - # PYTHON_VERSION: "3.4.1" - # PYTHON_ARCH: "64" + PATH: C:\Ruby23\bin;C:\Ruby23-x64\DevKit\mingw\bin;C:\Python27;C:\Python27\Scripts;%PATH% init: - cmd: rd /s /q %CHOCOLATEYINSTALL% - ps: iex ((new-object net.webclient).DownloadString('https://chocolatey.org/install.ps1')) install: - - - ECHO "Filesystem root:" - - ps: "ls \"C:/\"" - - - cinst atom -y - - cd %APPVEYOR_BUILD_FOLDER% - # Add Atom's bin (apm, etc) to PATH - - SET PATH=%LOCALAPPDATA%\atom\bin;%PATH% + - cinst packages.config -y + - refreshenv - apm install - # Install CLI beautifiers + # https://packaging.python.org/guides/supporting-windows-using-appveyor/ + - pip install -r requirements.txt - # Install Python (from the official .msi of http://python.org) and pip when - # not already installed. - - "powershell ./appveyor/install.ps1" + # Gemfile Install + - bundle install - # Prepend newly installed Python to the PATH of this build (this cannot be - # done from inside the powershell script as it would require to restart - # the parent CMD process). - - "SET PATH=%PYTHON%;%PYTHON%\\Scripts;%PATH%" - - # Check that we have the expected version and architecture for Python - - "python --version" - - "python -c \"import struct; print(struct.calcsize('P') * 8)\"" - - # Install the build dependencies of the project. If some dependencies contain - # compiled extensions and are not provided as pre-built wheel packages, - # pip will build them from source using the MSVC compiler matching the - # target Python version and architecture - - "%CMD_IN_ENV% pip install --upgrade autopep8" - - where autopep8 - - - "%CMD_IN_ENV% pip install --upgrade isort" - - where isort - - - "%CMD_IN_ENV% pip install --upgrade sqlparse" - - # Ruby & Gem - - SET PATH=C:\Ruby%RUBY_VERSION%\bin;C:\Ruby23-x64\DevKit\mingw\bin;%PATH% - # Rubocop - - gem install rubocop - - where rubocop - # HTMLBeautifier - - gem install htmlbeautifier - - where htmlbeautifier - # Puppet-Lint - - gem install puppet-lint - - where puppet-lint - # Sass - - gem install sass - - where sass-convert - - # emacs - - cinst emacs -y - - where emacs - - # terraform - - cinst terraform -y - - where terraform - - # FIXME: Enable allowEmptyChecksums, until someone fixes the checksum issue of php - - choco feature enable -n allowEmptyChecksums # PHP - ps: Set-Service wuauserv -StartupType Manual - - cinst php -y - - ps: "ls \"C:\\tools\\php72\"" - - "SET PATH=C:\\tools\\php72;%PATH%" - - where php # PHP-CS-Fixer - - cinst curl -y # Use cURL to download file from URL - - curl http://get.sensiolabs.org/php-cs-fixer.phar -o php-cs-fixer - - "SET PATH=%cd%;%PATH%" # Add current working directory to PATH - - where php-cs-fixer - - # Uncrustify - - curl -k -L https://sourceforge.net/projects/uncrustify/files/uncrustify/uncrustify-0.65/uncrustify-0.65-win32.zip/download -o uncrustify.zip - - cinst 7zip.commandline -y - - 7za e uncrustify.zip -ouncrustify-d - - "SET PATH=%cd%\\uncrustify-d;%PATH%" - - where uncrustify + - composer install # elm-format - - curl -k -L https://github.com/avh4/elm-format/releases/download/0.7.0-exp/elm-format-0.18-0.7.0-exp-win-i386.zip -o elm-format.zip - - 7za e elm-format.zip -oelm-format-d - - "SET PATH=%cd%\\elm-format-d;%PATH%" - - where elm-format - - # Beautysh - - pip install beautysh - - where beautysh - + - npm install -g elm-format@exp + build_script: - - cd %APPVEYOR_BUILD_FOLDER% # Install languages to Atom - - apm install language-marko language-html-swig language-svg language-elm language-d mavensmate-atom language-lua language-puppet fuse - # Show current PATH - - echo %PATH% + - apm install --packages-file atom-packages.txt # Run tests on package #- "%LOCALAPPDATA%\\atom\\bin\\atom.cmd --test spec" - apm test --path %LOCALAPPDATA%/atom/bin/atom.cmd diff --git a/appveyor/install.ps1 b/appveyor/install.ps1 deleted file mode 100644 index 0f165d8..0000000 --- a/appveyor/install.ps1 +++ /dev/null @@ -1,180 +0,0 @@ -# Sample script to install Python and pip under Windows -# Authors: Olivier Grisel, Jonathan Helmus and Kyle Kastner -# License: CC0 1.0 Universal: http://creativecommons.org/publicdomain/zero/1.0/ - -$MINICONDA_URL = "http://repo.continuum.io/miniconda/" -$BASE_URL = "https://www.python.org/ftp/python/" -$GET_PIP_URL = "https://bootstrap.pypa.io/get-pip.py" -$GET_PIP_PATH = "C:\get-pip.py" - - -function DownloadPython ($python_version, $platform_suffix) { - $webclient = New-Object System.Net.WebClient - $filename = "python-" + $python_version + $platform_suffix + ".msi" - $url = $BASE_URL + $python_version + "/" + $filename - - $basedir = $pwd.Path + "\" - $filepath = $basedir + $filename - if (Test-Path $filename) { - Write-Host "Reusing" $filepath - return $filepath - } - - # Download and retry up to 3 times in case of network transient errors. - Write-Host "Downloading" $filename "from" $url - $retry_attempts = 2 - for($i=0; $i -lt $retry_attempts; $i++){ - try { - $webclient.DownloadFile($url, $filepath) - break - } - Catch [Exception]{ - Start-Sleep 1 - } - } - if (Test-Path $filepath) { - Write-Host "File saved at" $filepath - } else { - # Retry once to get the error message if any at the last try - $webclient.DownloadFile($url, $filepath) - } - return $filepath -} - - -function InstallPython ($python_version, $architecture, $python_home) { - Write-Host "Installing Python" $python_version "for" $architecture "bit architecture to" $python_home - if (Test-Path $python_home) { - Write-Host $python_home "already exists, skipping." - return $false - } - if ($architecture -eq "32") { - $platform_suffix = "" - } else { - $platform_suffix = ".amd64" - } - $msipath = DownloadPython $python_version $platform_suffix - Write-Host "Installing" $msipath "to" $python_home - $install_log = $python_home + ".log" - $install_args = "/qn /log $install_log /i $msipath TARGETDIR=$python_home" - $uninstall_args = "/qn /x $msipath" - RunCommand "msiexec.exe" $install_args - if (-not(Test-Path $python_home)) { - Write-Host "Python seems to be installed else-where, reinstalling." - RunCommand "msiexec.exe" $uninstall_args - RunCommand "msiexec.exe" $install_args - } - if (Test-Path $python_home) { - Write-Host "Python $python_version ($architecture) installation complete" - } else { - Write-Host "Failed to install Python in $python_home" - Get-Content -Path $install_log - Exit 1 - } -} - -function RunCommand ($command, $command_args) { - Write-Host $command $command_args - Start-Process -FilePath $command -ArgumentList $command_args -Wait -Passthru -} - - -function InstallPip ($python_home) { - $pip_path = $python_home + "\Scripts\pip.exe" - $python_path = $python_home + "\python.exe" - if (-not(Test-Path $pip_path)) { - Write-Host "Installing pip..." - $webclient = New-Object System.Net.WebClient - $webclient.DownloadFile($GET_PIP_URL, $GET_PIP_PATH) - Write-Host "Executing:" $python_path $GET_PIP_PATH - Start-Process -FilePath "$python_path" -ArgumentList "$GET_PIP_PATH" -Wait -Passthru - } else { - Write-Host "pip already installed." - } -} - - -function DownloadMiniconda ($python_version, $platform_suffix) { - $webclient = New-Object System.Net.WebClient - if ($python_version -eq "3.4") { - $filename = "Miniconda3-3.5.5-Windows-" + $platform_suffix + ".exe" - } else { - $filename = "Miniconda-3.5.5-Windows-" + $platform_suffix + ".exe" - } - $url = $MINICONDA_URL + $filename - - $basedir = $pwd.Path + "\" - $filepath = $basedir + $filename - if (Test-Path $filename) { - Write-Host "Reusing" $filepath - return $filepath - } - - # Download and retry up to 3 times in case of network transient errors. - Write-Host "Downloading" $filename "from" $url - $retry_attempts = 2 - for($i=0; $i -lt $retry_attempts; $i++){ - try { - $webclient.DownloadFile($url, $filepath) - break - } - Catch [Exception]{ - Start-Sleep 1 - } - } - if (Test-Path $filepath) { - Write-Host "File saved at" $filepath - } else { - # Retry once to get the error message if any at the last try - $webclient.DownloadFile($url, $filepath) - } - return $filepath -} - - -function InstallMiniconda ($python_version, $architecture, $python_home) { - Write-Host "Installing Python" $python_version "for" $architecture "bit architecture to" $python_home - if (Test-Path $python_home) { - Write-Host $python_home "already exists, skipping." - return $false - } - if ($architecture -eq "32") { - $platform_suffix = "x86" - } else { - $platform_suffix = "x86_64" - } - $filepath = DownloadMiniconda $python_version $platform_suffix - Write-Host "Installing" $filepath "to" $python_home - $install_log = $python_home + ".log" - $args = "/S /D=$python_home" - Write-Host $filepath $args - Start-Process -FilePath $filepath -ArgumentList $args -Wait -Passthru - if (Test-Path $python_home) { - Write-Host "Python $python_version ($architecture) installation complete" - } else { - Write-Host "Failed to install Python in $python_home" - Get-Content -Path $install_log - Exit 1 - } -} - - -function InstallMinicondaPip ($python_home) { - $pip_path = $python_home + "\Scripts\pip.exe" - $conda_path = $python_home + "\Scripts\conda.exe" - if (-not(Test-Path $pip_path)) { - Write-Host "Installing pip..." - $args = "install --yes pip" - Write-Host $conda_path $args - Start-Process -FilePath "$conda_path" -ArgumentList $args -Wait -Passthru - } else { - Write-Host "pip already installed." - } -} - -function main () { - InstallPython $env:PYTHON_VERSION $env:PYTHON_ARCH $env:PYTHON - InstallPip $env:PYTHON -} - -main diff --git a/appveyor/run_with_env.cmd b/appveyor/run_with_env.cmd deleted file mode 100644 index 3a472bc..0000000 --- a/appveyor/run_with_env.cmd +++ /dev/null @@ -1,47 +0,0 @@ -:: To build extensions for 64 bit Python 3, we need to configure environment -:: variables to use the MSVC 2010 C++ compilers from GRMSDKX_EN_DVD.iso of: -:: MS Windows SDK for Windows 7 and .NET Framework 4 (SDK v7.1) -:: -:: To build extensions for 64 bit Python 2, we need to configure environment -:: variables to use the MSVC 2008 C++ compilers from GRMSDKX_EN_DVD.iso of: -:: MS Windows SDK for Windows 7 and .NET Framework 3.5 (SDK v7.0) -:: -:: 32 bit builds do not require specific environment configurations. -:: -:: Note: this script needs to be run with the /E:ON and /V:ON flags for the -:: cmd interpreter, at least for (SDK v7.0) -:: -:: More details at: -:: https://github.com/cython/cython/wiki/64BitCythonExtensionsOnWindows -:: http://stackoverflow.com/a/13751649/163740 -:: -:: Author: Olivier Grisel -:: License: CC0 1.0 Universal: http://creativecommons.org/publicdomain/zero/1.0/ -@ECHO OFF - -SET COMMAND_TO_RUN=%* -SET WIN_SDK_ROOT=C:\Program Files\Microsoft SDKs\Windows - -SET MAJOR_PYTHON_VERSION="%PYTHON_VERSION:~0,1%" -IF %MAJOR_PYTHON_VERSION% == "2" ( - SET WINDOWS_SDK_VERSION="v7.0" -) ELSE IF %MAJOR_PYTHON_VERSION% == "3" ( - SET WINDOWS_SDK_VERSION="v7.1" -) ELSE ( - ECHO Unsupported Python version: "%MAJOR_PYTHON_VERSION%" - EXIT 1 -) - -IF "%PYTHON_ARCH%"=="64" ( - ECHO Configuring Windows SDK %WINDOWS_SDK_VERSION% for Python %MAJOR_PYTHON_VERSION% on a 64 bit architecture - SET DISTUTILS_USE_SDK=1 - SET MSSdk=1 - "%WIN_SDK_ROOT%\%WINDOWS_SDK_VERSION%\Setup\WindowsSdkVer.exe" -q -version:%WINDOWS_SDK_VERSION% - "%WIN_SDK_ROOT%\%WINDOWS_SDK_VERSION%\Bin\SetEnv.cmd" /x64 /release - ECHO Executing: %COMMAND_TO_RUN% - call %COMMAND_TO_RUN% || EXIT 1 -) ELSE ( - ECHO Using default MSVC build environment for 32 bit architecture - ECHO Executing: %COMMAND_TO_RUN% - call %COMMAND_TO_RUN% || EXIT 1 -) diff --git a/atom-packages.txt b/atom-packages.txt new file mode 100644 index 0000000..aa032ad --- /dev/null +++ b/atom-packages.txt @@ -0,0 +1,9 @@ +language-marko +language-html-swig +language-svg +language-d +mavensmate-atom +language-lua +language-elm +language-puppet +fuse diff --git a/build-package.sh b/build-package.sh index 98674d1..eaade9a 100644 --- a/build-package.sh +++ b/build-package.sh @@ -1,63 +1,21 @@ #!/bin/sh -echo "Downloading latest Atom release..." -ATOM_CHANNEL="${ATOM_CHANNEL:=stable}" - -if [ "$TRAVIS_OS_NAME" = "osx" ]; then - curl -s -L "https://atom.io/download/mac?channel=$ATOM_CHANNEL" \ - -H 'Accept: application/octet-stream' \ - -o "atom.zip" - mkdir atom - unzip -q atom.zip -d atom - if [ "$ATOM_CHANNEL" = "stable" ]; then - export ATOM_APP_NAME="Atom.app" - export ATOM_SCRIPT_NAME="atom.sh" - export ATOM_SCRIPT_PATH="./atom/${ATOM_APP_NAME}/Contents/Resources/app/atom.sh" - else - export ATOM_APP_NAME="Atom ${ATOM_CHANNEL}.app" - export ATOM_SCRIPT_NAME="atom-${ATOM_CHANNEL}" - export ATOM_SCRIPT_PATH="./atom-${ATOM_CHANNEL}" - ln -s "./atom/${ATOM_APP_NAME}/Contents/Resources/app/atom.sh" "${ATOM_SCRIPT_PATH}" - fi - export PATH="$PWD/atom/${ATOM_APP_NAME}/Contents/Resources/app/apm/bin:$PATH" - export ATOM_PATH="./atom" - export APM_SCRIPT_PATH="./atom/${ATOM_APP_NAME}/Contents/Resources/app/apm/node_modules/.bin/apm" -else - curl -s -L "https://atom.io/download/deb?channel=$ATOM_CHANNEL" \ - -H 'Accept: application/octet-stream' \ - -o "atom.deb" +if [ "$TRAVIS_OS_NAME" != "osx" ]; then /sbin/start-stop-daemon --start --quiet --pidfile /tmp/custom_xvfb_99.pid --make-pidfile --background --exec /usr/bin/Xvfb -- :99 -ac -screen 0 1280x1024x16 export DISPLAY=":99" - dpkg-deb -x atom.deb "$HOME/atom" - if [ "$ATOM_CHANNEL" = "stable" ]; then - export ATOM_SCRIPT_NAME="atom" - export APM_SCRIPT_NAME="apm" - else - export ATOM_SCRIPT_NAME="atom-$ATOM_CHANNEL" - export APM_SCRIPT_NAME="apm-$ATOM_CHANNEL" - fi - export ATOM_SCRIPT_PATH="$HOME/atom/usr/bin/$ATOM_SCRIPT_NAME" - export APM_SCRIPT_PATH="$HOME/atom/usr/bin/$APM_SCRIPT_NAME" fi - echo "Using Atom version:" -"$ATOM_SCRIPT_PATH" -v +"$ATOM_SCRIPT_NAME" -v echo "Using APM version:" -"$APM_SCRIPT_PATH" -v +"$APM_SCRIPT_NAME" -v echo "Downloading package dependencies..." -"$APM_SCRIPT_PATH" clean -"$APM_SCRIPT_PATH" install +"$APM_SCRIPT_NAME" clean +"$APM_SCRIPT_NAME" install -TEST_PACKAGES="${APM_TEST_PACKAGES:=none}" - -if [ "$TEST_PACKAGES" != "none" ]; then - echo "Installing atom package dependencies..." - for pack in $TEST_PACKAGES ; do - "$APM_SCRIPT_PATH" install $pack - done -fi +echo "Installing atom package dependencies..." +"$APM_SCRIPT_NAME" install --packages-file atom-packages.txt if [ -f ./node_modules/.bin/coffeelint ]; then if [ -d ./src ]; then @@ -100,9 +58,9 @@ fi if [ -d ./spec ]; then echo "Running specs..." - "$ATOM_SCRIPT_PATH" --test spec + "$ATOM_SCRIPT_NAME" --test spec else echo "Missing spec folder! Please consider adding a test suite in `./spec`" exit 1 fi -exit \ No newline at end of file +exit diff --git a/composer.json b/composer.json new file mode 100644 index 0000000..5c33245 --- /dev/null +++ b/composer.json @@ -0,0 +1,5 @@ +{ + "require": { + "friendsofphp/php-cs-fixer": ">0" + } +} diff --git a/packages.config b/packages.config new file mode 100644 index 0000000..0c544bc --- /dev/null +++ b/packages.config @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..e3d1477 --- /dev/null +++ b/requirements.txt @@ -0,0 +1,4 @@ +autopep8 +isort +sqlparse +beautysh From 78a927992c1e6257df5afa6e333a65d700432e71 Mon Sep 17 00:00:00 2001 From: Steven Zeck Date: Wed, 17 Jan 2018 13:08:36 -0600 Subject: [PATCH 43/49] Add language generic for Travis builds --- .travis.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.travis.yml b/.travis.yml index 5da898d..07c27c2 100644 --- a/.travis.yml +++ b/.travis.yml @@ -11,6 +11,8 @@ notifications: script: sh build-package.sh +language: generic + cache: timeout: 1000 From 39deb8e534acdea3acb09cb0f4467a12b09a6ae5 Mon Sep 17 00:00:00 2001 From: Glavin Wiechert Date: Wed, 17 Jan 2018 22:49:01 -0400 Subject: [PATCH 44/49] Add link to Unibeautify Bot form --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 040ec4e..2dde5f0 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,9 @@ [![Paypal Donations](https://www.paypalobjects.com/en_US/i/btn/btn_donate_SM.gif)](https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=X2RK5DKN6YXPJ&lc=CA&item_name=Atom%2dBeautify&item_number=atom%2dbeautify¤cy_code=CAD&bn=PP%2dDonationsBF%3abtn_donate_LG%2egif%3aNonHosted) [![Twitter URL](https://img.shields.io/twitter/url/http/shields.io.svg?style=social)](https://twitter.com/unibeautify) -**Help improve Atom-Beautify by completing the questionnaire: [https://goo.gl/iEHBNr](https://goo.gl/iEHBNr)** +**Sign up for Unibeautify Bot: [https://goo.gl/jmM4QN](https://goo.gl/jmM4QN)** + +**Help improve Atom-Beautify by completing the quick questionnaire: [https://goo.gl/iEHBNr](https://goo.gl/iEHBNr)** | Mac OS and | | | --- | --- | From 7f43e9613a85a2b059128dbb619796d4d10e2df5 Mon Sep 17 00:00:00 2001 From: Glavin Wiechert Date: Wed, 17 Jan 2018 22:50:48 -0400 Subject: [PATCH 45/49] Add Unibeautify Bot link to README-template --- README-template.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README-template.md b/README-template.md index ec5ab35..ac4abb3 100644 --- a/README-template.md +++ b/README-template.md @@ -8,7 +8,9 @@ [![Paypal Donations](https://www.paypalobjects.com/en_US/i/btn/btn_donate_SM.gif)](https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=X2RK5DKN6YXPJ&lc=CA&item_name=Atom%2dBeautify&item_number=atom%2dbeautify¤cy_code=CAD&bn=PP%2dDonationsBF%3abtn_donate_LG%2egif%3aNonHosted) [![Twitter URL](https://img.shields.io/twitter/url/http/shields.io.svg?style=social)](https://twitter.com/unibeautify) -**Help improve Atom-Beautify by completing the questionnaire: [https://goo.gl/iEHBNr](https://goo.gl/iEHBNr)** +**Sign up for Unibeautify Bot: [https://goo.gl/jmM4QN](https://goo.gl/jmM4QN)** + +**Help improve Atom-Beautify by completing the quick questionnaire: [https://goo.gl/iEHBNr](https://goo.gl/iEHBNr)** | Mac OS and | | | --- | --- | From 1987f7d81fbed61a21b4d3ccc967f63b2547cfdc Mon Sep 17 00:00:00 2001 From: Steven Zeck Date: Fri, 26 Jan 2018 13:28:23 -0600 Subject: [PATCH 46/49] Output gem info during build --- build-package.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/build-package.sh b/build-package.sh index eaade9a..e32fc28 100644 --- a/build-package.sh +++ b/build-package.sh @@ -5,6 +5,10 @@ if [ "$TRAVIS_OS_NAME" != "osx" ]; then export DISPLAY=":99" fi +echo "Gem Info" +bundle info puppet-lint +bundle info sass + echo "Using Atom version:" "$ATOM_SCRIPT_NAME" -v echo "Using APM version:" From 5d0a33868470328dfd1fc9fb68499267a260d9a7 Mon Sep 17 00:00:00 2001 From: Glavin Wiechert Date: Sun, 28 Jan 2018 17:52:02 -0400 Subject: [PATCH 47/49] Change Unibeautify Bot to Unibeautify CI in README --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 2dde5f0..0a75b7a 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ [![Paypal Donations](https://www.paypalobjects.com/en_US/i/btn/btn_donate_SM.gif)](https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=X2RK5DKN6YXPJ&lc=CA&item_name=Atom%2dBeautify&item_number=atom%2dbeautify¤cy_code=CAD&bn=PP%2dDonationsBF%3abtn_donate_LG%2egif%3aNonHosted) [![Twitter URL](https://img.shields.io/twitter/url/http/shields.io.svg?style=social)](https://twitter.com/unibeautify) -**Sign up for Unibeautify Bot: [https://goo.gl/jmM4QN](https://goo.gl/jmM4QN)** +**Sign up for Unibeautify CI: [https://goo.gl/jmM4QN](https://goo.gl/jmM4QN)** **Help improve Atom-Beautify by completing the quick questionnaire: [https://goo.gl/iEHBNr](https://goo.gl/iEHBNr)** From 7ee1b193f786d0e26b69b734b30a5fb4281b4bdb Mon Sep 17 00:00:00 2001 From: Glavin Wiechert Date: Sun, 28 Jan 2018 17:52:31 -0400 Subject: [PATCH 48/49] Change Unibeautify Bot to Unibeautify CI in README-template --- README-template.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README-template.md b/README-template.md index ac4abb3..2d743ef 100644 --- a/README-template.md +++ b/README-template.md @@ -8,7 +8,7 @@ [![Paypal Donations](https://www.paypalobjects.com/en_US/i/btn/btn_donate_SM.gif)](https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=X2RK5DKN6YXPJ&lc=CA&item_name=Atom%2dBeautify&item_number=atom%2dbeautify¤cy_code=CAD&bn=PP%2dDonationsBF%3abtn_donate_LG%2egif%3aNonHosted) [![Twitter URL](https://img.shields.io/twitter/url/http/shields.io.svg?style=social)](https://twitter.com/unibeautify) -**Sign up for Unibeautify Bot: [https://goo.gl/jmM4QN](https://goo.gl/jmM4QN)** +**Sign up for Unibeautify CI: [https://goo.gl/jmM4QN](https://goo.gl/jmM4QN)** **Help improve Atom-Beautify by completing the quick questionnaire: [https://goo.gl/iEHBNr](https://goo.gl/iEHBNr)** From 328e21b1e6ab97e9cae2b0297e73957562346af0 Mon Sep 17 00:00:00 2001 From: Steven Zeck Date: Mon, 29 Jan 2018 17:47:33 -0600 Subject: [PATCH 49/49] Remove gem info --- build-package.sh | 4 ---- 1 file changed, 4 deletions(-) diff --git a/build-package.sh b/build-package.sh index e32fc28..eaade9a 100644 --- a/build-package.sh +++ b/build-package.sh @@ -5,10 +5,6 @@ if [ "$TRAVIS_OS_NAME" != "osx" ]; then export DISPLAY=":99" fi -echo "Gem Info" -bundle info puppet-lint -bundle info sass - echo "Using Atom version:" "$ATOM_SCRIPT_NAME" -v echo "Using APM version:"