From dc1b66d1b9f8dd48b80e61a8af66a0d799ea8019 Mon Sep 17 00:00:00 2001 From: Glavin Wiechert Date: Tue, 20 Jun 2017 00:39:14 -0300 Subject: [PATCH] Fixes #1030. Add support for alpha versions of autopep8 See https://github.com/Glavin001/atom-beautify/issues/1030#issuecomment-309371093 --- CHANGELOG.md | 1 + src/beautifiers/autopep8.coffee | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b83ef30..031fb27 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,5 @@ # Next +- Fixes [#1030](https://github.com/Glavin001/atom-beautify/issues/1030). Add support for alpha versions of autopep8 - Fixes [#1725](https://github.com/Glavin001/atom-beautify/issues/1725). Fix version parsing of PHP executable - Fixes [#1730](https://github.com/Glavin001/atom-beautify/issues/1730). Correctly parse PHPCBF version and improve handling of Executable - ... diff --git a/src/beautifiers/autopep8.coffee b/src/beautifiers/autopep8.coffee index fe2e7b0..d5fbd30 100644 --- a/src/beautifiers/autopep8.coffee +++ b/src/beautifiers/autopep8.coffee @@ -16,7 +16,11 @@ module.exports = class Autopep8 extends Beautifier homepage: "https://github.com/hhatto/autopep8" installation: "https://github.com/hhatto/autopep8#installation" version: { - parse: (text) -> text.match(/autopep8 (\d+\.\d+\.\d+)/)[1] + parse: (text) -> + try + text.match(/autopep8 (\d+\.\d+\.\d+)/)[1] + catch + text.match(/autopep8 (\d+\.\d+)/)[1] + ".0" runOptions: { returnStdoutOrStderr: true }