622 Commits

Author SHA1 Message Date
Liam Newman
ae1efd634d Brackeless if-else defining a function
Fixes #838
2016-01-26 18:13:05 -08:00
Liam Newman
0a41de325f Added test for short attribute xml 2016-01-26 17:25:37 -08:00
Liam Newman
b5bdf3a813 JSX/XML short attributes
Fixes #161
Fixes #834
2016-01-26 17:23:09 -08:00
Liam Newman
442cc05cec Arrow functions can have StatementBlocks
Fixes #854
2016-01-26 16:35:44 -08:00
Liam Newman
55f111eecd Destructuring, importing, and short objects
Fixes #114
Fixes #315
Fixes #370
Fixes #382
2016-01-26 02:23:48 -08:00
Liam Newman
35a2a83d41 Fix python testing 2016-01-22 11:39:38 -08:00
Liam Newman
322502c75b Add exponential operator
Fixes #825
2016-01-22 11:07:09 -08:00
Liam Newman
d7f4e362c0 Re-enable discovery and execution of python tests
Unites discover in python requires that tests be importable modules.
The means they have to have a __init.py__ in their directory.
2016-01-22 11:06:04 -08:00
Glenn Moss
21eb8fb9c2 Prevent incorrect wrapping of return statements.
There cannot be a newline between the return keyword and the start of
the return value expression.

Closes #751
2016-01-21 16:21:16 -08:00
Liam Newman
3369b49d03 Do not use hardcoded directory for tests
Closes #788
2016-01-21 15:18:50 -08:00
Liam Newman
bd9d03aeb2 Read piped input by default
Closes #558
2016-01-21 14:14:05 -08:00
Liam Newman
db897211fa Replace makefile dependency with bash script
Switched to a bash script for build.  Not great but make is
not convenient on windows machines.

Bash is everywhere and our commands are not complex.

Fixes #638
2016-01-20 15:45:45 -08:00
Liam Newman
796f080226 Add eol = "auto" option as the default behavior.
Fixes #829
2016-01-19 13:00:04 -08:00
Liam Newman
98411a49a4 Add appveyor config 2016-01-15 22:07:10 -08:00
Liam Newman
185e991ba7 Move generated test files into generated folders 2016-01-15 22:07:10 -08:00
Liam Newman
047f8e4a0e Add auto-generated header 2016-01-15 22:07:10 -08:00
Matthias Urlichs
814bec0e46 Update Python's setup.py
* distutils no longer works correctly
* fixed testing: use the py.test framework
2015-12-13 23:50:56 +01:00
Matthias Urlichs
7cfdf06ae1 Debianized. 2015-12-13 17:36:34 +01:00
Liam Newman
e24c6ae6fd Fixes for errors introduced in #803 2015-11-27 17:19:50 -08:00
Liam Newman
07b39882d0 More cases for #602 2015-11-26 12:47:16 -08:00
Liam Newman
73da7d2021 Reformat tests for #602 2015-11-26 10:53:37 -08:00
Ryan Murphy
8f221a3d2a Resolves #602: Detect ObjectLiteral by checking surrounding context, to handle when ES6 shorthand function is first prop 2015-11-25 22:44:08 -05:00
Michael Pelikan
80c8368f27 Adding support for binary numeric literal form. 2015-11-19 13:52:11 -08:00
Tim Burke
dc472ee651 Resolves #810: Add test for es6 object literal detection. 2015-11-19 15:06:54 -05:00
Tim Burke
86e5bb2749 Remove redundant conditional check. 2015-11-18 00:30:29 -05:00
Tim Burke
d2520bf2ed Do the python version too. 2015-11-18 00:24:00 -05:00
Tim Burke
0c8537b783 Resolve #806: Preserve newline on arrow functions. 2015-11-18 00:06:39 -05:00
Liam Newman
dec88545f6 Merge pull request #793 from mpelikan/master
Fixed issue with ES6 support for octal strings as 0o123.
2015-11-09 16:48:31 -08:00
Michael Pelikan
8bd015af5d Fixed issue with ES6 support for octal strings as 0o123. 2015-10-21 16:53:25 -06:00
Alan MacDougall
569f122152 Resolves #685: Permit ES7 decorators.
Although decorators are just a proposal [1], they are already
implemented in Babel, and used in some frameworks. Currently,
js-beautifier adds a line break after the unexpected "@" characters in
the decorator invocation. With this commit, "@" will be an accepted
identifier leader, like A-Z, a-z, $, and _.

1: https://github.com/wycats/javascript-decorators
2015-08-26 11:46:35 -04:00
Liam Newman
8037c2953b Remove old template operator patterns 2015-06-30 11:30:06 -07:00
Liam Newman
846f766c85 Python 1.5.10 2015-06-25 15:47:30 -04:00
Liam Newman
7360692d43 Hotfix for directives
Support multiple directives in one block
Fix block finding for blocks after first block

Fixes #723
2015-06-24 11:18:56 -07:00
Liam Newman
e6f4bddb8d Python 1.5.7 2015-06-19 15:27:27 -07:00
Liam Newman
1b4be9b13c Add eol option to all components
Some of this is hacky ways to normalizing the inputs.  Unfortunate, but effective.

Closes #715
2015-06-18 14:03:46 -07:00
Liam Newman
4cbe64a547 Support selector separator newline in nested selectors
Fixes #666
2015-06-17 11:27:35 -07:00
Liam Newman
0ff29405de Nested pseudoclasses can have parens
Fixes #557
2015-06-16 19:02:21 -07:00
Liam Newman
fe4026f3de Fix SASS/SCSS interpolation
Fixes #689
2015-06-16 12:12:52 -07:00
Liam Newman
c73dea8d6a Ensure multi-line string continuations 2015-06-16 10:53:55 -07:00
Liam Newman
13b8031804 Make js-beautifier kinder to templateing
Related to #490, #417
2015-06-15 22:27:41 -07:00
Liam Newman
6163246a14 Add "ignore" directive, skip tokenizing inside section
This adds directive to not even tokenize a section.
Effectively treats the text inside as a comment.

Closes #384
2015-06-15 15:30:31 -07:00
Liam Newman
5f8fd65a08 Support "preserve" directive in javascript, leave code unchanged
// Text below will remain unchanged
/* beautify preserve:start */
{asdklgh;y;;{}dd2d}
/* beautify preserve:end */

NOTE: this is not quiet ignore - still tracks tokens.
Non-javascript may not work.

Related #384
2015-06-15 15:00:36 -07:00
Liam Newman
e275024f29 Add raw output mode that preserves all formatting, still converts newlines
This will be used as the underlying implementation for ignore blocks.
It is a general behavior that can be applied anywhere during output
construction.  This allows us to test this on most inputs to ensure
correctness.
2015-06-15 10:25:28 -07:00
Liam Newman
0357431d1c Refactor comment tokenization 2015-06-12 17:28:46 -07:00
Liam Newman
5f09c45524 Version update for 1.5.6 2015-05-27 18:02:05 -07:00
Liam Newman
f8dcef139c Correctly indent functions followed by comments
Fixes #583
Fixes #691
2015-05-27 16:43:38 -07:00
Liam Newman
1dba7379b0 Allow python --replace on files in the current directory
Fixes #686
2015-05-27 15:04:03 -07:00
Liam Newman
3e267770e9 Do not add extra newline for non-header comments
Fixes #609
2015-05-26 18:11:53 -07:00
Liam Newman
fea94e6fce Merge pull request #684 from rlindner81/Fix587
Fixes issue #587 for javascript implementation
2015-05-26 11:32:58 -07:00
Paul Tremberth
6ff52daab5 Add tests and fix js based tokenizer too 2015-05-17 20:19:57 +02:00