forked from pool/StyLua
- Update to version 2.0.2:
* Fixed regression where configuration present in current working directory not used when formatting from stdin and no --stdin-filepath is provided * Luau: fixed incorrect indentation for leading token in union / intersection when hanging * Verbose mode will now show resolved options * Fixed CLI overrides not applying on top of a resolved stylua.toml file * For automated downloaders: the legacy release artifacts stylua-win64.zip, stylua-linux.zip and stylua-macos.zip are no longer produced in GitHub releases, in favour of more specific names (e.g., stylua-windows-x86_64, stylua-linux-x86_64 and stylua-macos-x86_64). * --stdin-filepath no longer respects ignore files by default, in line with passing files directly to the command line. Now, stylua --stdin-filepath foo.lua - will still format the stdin even if foo.lua was in a .styluaignore file. Use --respect-ignores to preserve the original behaviour. * Removed deprecated access patterns on Config struct in stylua Rust library * Added runtime syntax configuration option syntax to help handle ambiguous syntax. By default, StyLua builds and runs with a parser to handle all Lua versions. However, the syntax of some Lua versions conflict with eachother: most notably, Lua 5.2+ goto label syntax :🏷️: and Luau type assertion operator ::. This option allows choosing what syntax to parse, to handle these conflicts. * Added configuration option space_after_function_names to specify whether to include a space between a function name and parentheses * Update internal Lua parser version (full-moon) to v1.1.0. This includes parser performance improvements. * LuaJIT is now separated from Lua52, and is available in its own feature and syntax flag * .stylua.toml config resolution now supports looking up config files next to files being formatted, recursively going upwards until reaching the current OBS-URL: https://build.opensuse.org/package/show/devel:languages:lua/StyLua?expand=0&rev=43
This commit is contained in:
23
.gitattributes
vendored
Normal file
23
.gitattributes
vendored
Normal file
@@ -0,0 +1,23 @@
|
||||
## Default LFS
|
||||
*.7z filter=lfs diff=lfs merge=lfs -text
|
||||
*.bsp filter=lfs diff=lfs merge=lfs -text
|
||||
*.bz2 filter=lfs diff=lfs merge=lfs -text
|
||||
*.gem filter=lfs diff=lfs merge=lfs -text
|
||||
*.gz filter=lfs diff=lfs merge=lfs -text
|
||||
*.jar filter=lfs diff=lfs merge=lfs -text
|
||||
*.lz filter=lfs diff=lfs merge=lfs -text
|
||||
*.lzma filter=lfs diff=lfs merge=lfs -text
|
||||
*.obscpio filter=lfs diff=lfs merge=lfs -text
|
||||
*.oxt filter=lfs diff=lfs merge=lfs -text
|
||||
*.pdf filter=lfs diff=lfs merge=lfs -text
|
||||
*.png filter=lfs diff=lfs merge=lfs -text
|
||||
*.rpm filter=lfs diff=lfs merge=lfs -text
|
||||
*.tbz filter=lfs diff=lfs merge=lfs -text
|
||||
*.tbz2 filter=lfs diff=lfs merge=lfs -text
|
||||
*.tgz filter=lfs diff=lfs merge=lfs -text
|
||||
*.ttf filter=lfs diff=lfs merge=lfs -text
|
||||
*.txz filter=lfs diff=lfs merge=lfs -text
|
||||
*.whl filter=lfs diff=lfs merge=lfs -text
|
||||
*.xz filter=lfs diff=lfs merge=lfs -text
|
||||
*.zip filter=lfs diff=lfs merge=lfs -text
|
||||
*.zst filter=lfs diff=lfs merge=lfs -text
|
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
||||
.osc
|
3
StyLua-0.20.0.tar.gz
Normal file
3
StyLua-0.20.0.tar.gz
Normal file
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:f4a27b12669953d2edf55b89cc80381f97a2dfa735f53f95c6ae6015c8c35ffb
|
||||
size 412838
|
3
StyLua-2.0.2.tar.gz
Normal file
3
StyLua-2.0.2.tar.gz
Normal file
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:0d88a55d4d33a7d7334bdef8ccaf1fb6524b21dd66d60be8efc0cf92f6d31ad3
|
||||
size 424426
|
250
StyLua.changes
Normal file
250
StyLua.changes
Normal file
@@ -0,0 +1,250 @@
|
||||
-------------------------------------------------------------------
|
||||
Sat Dec 14 01:01:25 UTC 2024 - Soc Virnyl Estela <uncomfyhalomacro@opensuse.org>
|
||||
|
||||
- Update to version 2.0.2:
|
||||
* Fixed regression where configuration present in current working directory
|
||||
not used when formatting from stdin and no --stdin-filepath is provided
|
||||
* Luau: fixed incorrect indentation for leading token in union / intersection
|
||||
when hanging
|
||||
* Verbose mode will now show resolved options
|
||||
* Fixed CLI overrides not applying on top of a resolved stylua.toml file
|
||||
* For automated downloaders: the legacy release artifacts stylua-win64.zip,
|
||||
stylua-linux.zip and stylua-macos.zip are no longer produced in GitHub
|
||||
releases, in favour of more specific names (e.g., stylua-windows-x86_64,
|
||||
stylua-linux-x86_64 and stylua-macos-x86_64).
|
||||
* --stdin-filepath no longer respects ignore files by default, in line with
|
||||
passing files directly to the command line. Now, stylua --stdin-filepath
|
||||
foo.lua - will still format the stdin even if foo.lua was in a .styluaignore
|
||||
file. Use --respect-ignores to preserve the original behaviour.
|
||||
* Removed deprecated access patterns on Config struct in stylua Rust library
|
||||
* Added runtime syntax configuration option syntax to help handle ambiguous
|
||||
syntax. By default, StyLua builds and runs with a parser to handle all Lua
|
||||
versions. However, the syntax of some Lua versions conflict with eachother:
|
||||
most notably, Lua 5.2+ goto label syntax ::label:: and Luau type assertion
|
||||
operator ::. This option allows choosing what syntax to parse, to handle
|
||||
these conflicts.
|
||||
* Added configuration option space_after_function_names to specify whether
|
||||
to include a space between a function name and parentheses
|
||||
* Update internal Lua parser version (full-moon) to v1.1.0. This includes
|
||||
parser performance improvements.
|
||||
* LuaJIT is now separated from Lua52, and is available in its own feature
|
||||
and syntax flag
|
||||
* .stylua.toml config resolution now supports looking up config files next to
|
||||
files being formatted, recursively going upwards until reaching the current
|
||||
working directory, then stopping (unless --search-parent-directories was
|
||||
specified). For example, for a file ./src/test.lua, executing stylua src/
|
||||
will look for ./src/stylua.toml and then ./stylua.toml.
|
||||
* When collapse_simple_statement is enabled, if the enclosing block is
|
||||
a return, we will check if the return expression is "simple" (currently,
|
||||
not containing a function definition)
|
||||
* Fixed formatting of method call chain when there is a comment between
|
||||
the colon token : and the function name
|
||||
* Removed accidental random print to stdout when formatting a return
|
||||
statement across multiple lines
|
||||
* Luau: Fixed incorrect removal of semicolon before compound assignment
|
||||
with parentheses leading to ambiguous syntax error
|
||||
* Luau: Fixed incorrect collapsing of union/intersection type value with
|
||||
comments in a type table leading to a syntax error
|
||||
* Fixed --verify panicing due to overflow for very large Hex numbers
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Wed Mar 6 02:07:17 UTC 2024 - Soc Virnyl Estela <uncomfy+openbuildservice@uncomfyhalomacro.pl>
|
||||
|
||||
- BuildRequires should be cargo and not rust+cargo
|
||||
* a known issue is causing some broken builds e.g. providing a lower version
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Wed Mar 6 01:58:43 UTC 2024 - Soc Virnyl Estela <uncomfy+openbuildservice@uncomfyhalomacro.pl>
|
||||
|
||||
- Reenable cargo tests.
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Sun Mar 3 17:02:11 UTC 2024 - Andrea Manzini <andrea.manzini@suse.com>
|
||||
|
||||
- Update to version 0.20.0:
|
||||
### Changed
|
||||
- Files excluded by git (via .gitignore or global git configuration), as well as in an .ignore file
|
||||
(used by ripgrep and The Silver Searcher) will now also be ignored by StyLua
|
||||
(as if they were all .styluaignore files).
|
||||
### Fixed
|
||||
* General
|
||||
- The CLI tool will now only write files if the contents differ, and not modify the file if there
|
||||
is no change after formatting
|
||||
- Fixed function body parentheses being placed on multiple lines unnecessarily when there are no parameters
|
||||
- Fixed directory paths w/o globs in .styluaignore not matching when using --respect-ignores
|
||||
* Luau
|
||||
- Fixed handling of floor division (//) syntax when only Luau command line flag is enabled
|
||||
- Fixed missing space when table is inside of Luau interpolated string expression ({{ is invalid syntax)
|
||||
- Fixed parentheses around a Luau compound type inside of a type table indexer being removed causing a syntax error
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Sun Nov 12 13:56:19 UTC 2023 - Soc Virnyl Estela <uncomfy+openbuildservice@uncomfyhalomacro.pl>
|
||||
|
||||
- Update to version 0.19.0:
|
||||
|
||||
### Added
|
||||
|
||||
- Added flag `--respect-ignores`. By default, files explicitly passed
|
||||
to stylua (e.g. `stylua foo.lua`) will always be formatted, regardless of
|
||||
whether the file is ignored. Enabling this flag will consider `.styluaignore`
|
||||
or glob matches before formatting the file.
|
||||
|
||||
- Note: for backwards compatibility reasons, formatting via stdin always
|
||||
respects ignores. This behaviour will change in the next major release
|
||||
|
||||
### Changed
|
||||
|
||||
- Updated parser crate with following changes:
|
||||
|
||||
- Support Luau floor division (`//`)
|
||||
- Fix Luau string interpolation parsing
|
||||
- Fix Luau `\z` escape parsing
|
||||
|
||||
- Simplified access and modification patterns for StyLua configuration. You
|
||||
can now access the properties directly
|
||||
|
||||
- **Deprecated:** the old access patterns of `.property()` and
|
||||
`.with_property()` are now deprecated
|
||||
- **Breaking Change (WASM):** due to JS/TS lack of differentiation
|
||||
between `.property` / `.property()` implementation, the `.property()`
|
||||
functions were removed from WASM output.
|
||||
|
||||
- Multiline comments before commas will now remain in place and not move
|
||||
to after the comma. This is to support type-assertions-via-comments that
|
||||
is commonly used by some language servers.
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Mon Oct 9 13:14:58 UTC 2023 - Soc Virnyl Estela <uncomfy+openbuildservice@uncomfyhalomacro.pl>
|
||||
|
||||
- Update to version 0.18.2:
|
||||
* Fixed LuaJIT suffixes LL/ULL causing a panic when running in --verify mode
|
||||
* Fixed incorrect formatting of conditionals when collapse_simple_statement is enabled and the block begins with an empty line
|
||||
* Fixed formatting of dot function call chains with comment between dot and names
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Sat Aug 26 13:42:49 UTC 2023 - Soc Virnyl Estela <socvirnyl.estela@gmail.com>
|
||||
|
||||
- Update to version 0.18.1:
|
||||
* Fixed parentheses around a single Luau type pack in a generic being removed causing syntax errors.
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Sun Aug 13 13:26:45 UTC 2023 - Soc Virnyl Estela <socvirnyl.estela@gmail.com>
|
||||
|
||||
- Replace obsoleted `disabled` option with `manual`
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Sun Jun 18 01:16:34 UTC 2023 - Soc Virnyl Estela <socvirnyl.estela@gmail.com>
|
||||
|
||||
- Update to version 0.18.0:
|
||||
* Multiline ignores (-- stylua: ignore start / -- stylua: ignore end) will now work within table fields
|
||||
* Added option "Input" to call_parentheses setting, where call parentheses are retained based on their presence in the original input code.
|
||||
* Improved heuristics around Luau type excess parentheses removal, so unnecessary parentheses around types are removed in more locations
|
||||
* Function calls are now formatted onto multiple lines if the opening brace { of a multiline table forces one of the lines over width
|
||||
* Fixed missing option --sort-requires to enable sort requires on the command line
|
||||
* Fixed parentheses removed around Luau optional type (B?) causing syntax errors when present in an intersection A & (B?)
|
||||
* Fixed comments lost when parentheses removed around Luau types
|
||||
* Fixed race condition where if a file is passed more than once as an argument to format, then it could potentially be wiped completely
|
||||
(for example, if an ancestor directory is passed and recursively searched, as well as the file itself)
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Fri Jun 9 11:41:54 UTC 2023 - Soc Virnyl Estela <socvirnyl.estela@gmail.com>
|
||||
|
||||
- Update to version 0.17.1
|
||||
* Bumped internal parser dependency which should fix parsing problems for comments with Chinese characters, and multiline string escapes
|
||||
* Fixed comments in punctuated lists for return statements or assignments being incorrectly formatted leading to syntax errors
|
||||
* Fixed line endings not being correctly formatted in multiline string literals and comments
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Tue Mar 21 04:37:50 UTC 2023 - Soc Virnyl Estela <socvirnyl.estela@gmail.com>
|
||||
|
||||
- Disable tests. Failing for editorconfig.
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Tue Mar 21 02:16:32 UTC 2023 - Soc Virnyl Estela <socvirnyl.estela@gmail.com>
|
||||
|
||||
- Remove editorconfig requirement.
|
||||
- Fix tests.
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Tue Mar 21 00:31:00 UTC 2023 - Soc Virnyl Estela <socvirnyl.estela@gmail.com>
|
||||
|
||||
- Fix tests.
|
||||
- Add editorconfig as build requirement.
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Sat Mar 18 11:40:33 UTC 2023 - Soc Virnyl Estela <socvirnyl.estela@gmail.com>
|
||||
|
||||
- Update to version 0.17.0:
|
||||
* Sort requires
|
||||
* Add default editorconfig feature
|
||||
* extension: Pass cwd as workspace folder for version check
|
||||
* Add Dockerfile
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Fri Feb 17 10:33:34 UTC 2023 - Soc Virnyl Estela <socvirnyl.estela@gmail.com>
|
||||
|
||||
- Update to version 0.16.1:
|
||||
* General
|
||||
- Fixed mistransformation of a function argument in a multilined function call when the argument
|
||||
contains a comment, causing a syntax error. We now attempt to hang the expression (#648)
|
||||
* Luau
|
||||
- Fixed verify AST flagging a false positive for parentheses removed around a Luau type (#643)
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Tue Feb 14 01:25:57 UTC 2023 - William Brown <william.brown@suse.com>
|
||||
|
||||
- Automatic update of vendored dependencies
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Sat Jan 28 00:55:26 UTC 2023 - Soc Virnyl Estela <socvirnyl.estela@gmail.com>
|
||||
|
||||
- Update to version 0.16.0:
|
||||
* Fixed an anonymous function assignment local x = function() being unnecessarily indented if the function body contains a comment (#627)
|
||||
* Fixed malformed formatting when there is a newline between a return token and the expressions (#605)
|
||||
* Fixed malformed formatting of multi-assignment or multi-returns where there is a comment within the expressions list (#637)
|
||||
* Update internal parser:
|
||||
- (lua52) Support Lua 5.2 fractional hexidecimal / hexidecimal with exponents (#621)
|
||||
- (lua52) Support LuaJIT number suffixes LL/ULL/i (#621)
|
||||
- (lua52) Support \z escape sequences in strings (#613)
|
||||
- (luau) Support Luau string interpolation (#607)
|
||||
* Several optimisations applied to formatting functions to reduce time taken. Files which previously did not terminate (6MB+) now finish in reasonable time. (#591)
|
||||
* Assignments of the form local name = function will no longer hang at the equals token, and instead force parameters multiline, to reduce unnecessary indentation. (#595)
|
||||
* Unnecessary parentheses around Luau types will now be removed (#611)
|
||||
* Collapse a body containing only a goto statement when collapse_simple_statement is set (#618)
|
||||
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Fri Dec 16 16:00:34 UTC 2022 - Soc Virnyl Estela <socvirnyl.estela@gmail.com>
|
||||
|
||||
- Disable --all-features in test since `cargo-insta` is
|
||||
not installed or available in openSUSE.
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Fri Dec 16 14:20:59 UTC 2022 - Soc Virnyl Estela <socvirnyl.estela@gmail.com>
|
||||
|
||||
- Update to version 0.15.3:
|
||||
* Fixed necessary parentheses removed in (-X) ^ Y causing change in semantics
|
||||
* Take into account function token size when formatting an anonymous function function() end (particularly relevant when collapsing simple statements)
|
||||
* Support hanging inside of Luau type arrays { T } to fix formatting issues when comments are present
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Thu Nov 24 13:56:02 UTC 2022 - Soc Virnyl Estela <socvirnyl.estela@gmail.com>
|
||||
|
||||
- Remove strip option for debuginfo creation.
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Mon Nov 21 06:40:00 UTC 2022 - Soc Virnyl Estela <socvirnyl.estela@gmail.com>
|
||||
|
||||
- Rename source tarball to StyLua-0.15.2.tar.gz.
|
||||
- Update _service file.
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Sun Nov 20 23:14:48 UTC 2022 - Soc Virnyl Estela <socvirnyl.estela@gmail.com>
|
||||
|
||||
- Change url macro to full URL in sources.
|
||||
- Profile "release" strips debug symbols in cargo_config.
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Sun Nov 20 09:51:59 UTC 2022 - Soc Virnyl Estela <socvirnyl.estela@gmail.com>
|
||||
|
||||
- Initial spec for StyLua version 0.15.2
|
55
StyLua.spec
Normal file
55
StyLua.spec
Normal file
@@ -0,0 +1,55 @@
|
||||
#
|
||||
# spec file for package StyLua
|
||||
#
|
||||
# Copyright (c) 2024 SUSE LLC
|
||||
#
|
||||
# All modifications and additions to the file contributed by third parties
|
||||
# remain the property of their copyright owners, unless otherwise agreed
|
||||
# upon. The license for this file, and modifications and additions to the
|
||||
# file, is the same license as for the pristine package itself (unless the
|
||||
# license for the pristine package is not an Open Source License, in which
|
||||
# case the license is the MIT License). An "Open Source License" is a
|
||||
# license that conforms to the Open Source Definition (Version 1.9)
|
||||
# published by the Open Source Initiative.
|
||||
|
||||
# Please submit bugfixes or comments via https://bugs.opensuse.org/
|
||||
#
|
||||
|
||||
|
||||
%define _bin_name stylua
|
||||
Name: StyLua
|
||||
Version: 2.0.2
|
||||
Release: 0
|
||||
Summary: Opinionated Lua code formatter
|
||||
License: (Apache-2.0 OR MIT) AND Unicode-DFS-2016 AND (Apache-2.0 OR BSL-1.0) AND (Apache-2.0 OR MIT) AND (MIT OR Unlicense) AND Apache-2.0 AND MIT AND MPL-2.0 AND MPL-2.0
|
||||
URL: https://github.com/JohnnyMorganz/StyLua
|
||||
Source0: https://github.com/JohnnyMorganz/StyLua/archive/refs/tags/v%{version}.tar.gz#/%{name}-%{version}.tar.gz
|
||||
Source1: vendor.tar.zst
|
||||
BuildRequires: cargo
|
||||
BuildRequires: cargo-packaging
|
||||
BuildRequires: zstd
|
||||
|
||||
%description
|
||||
StyLua is an opinonated code formatter for Lua 5.1, 5.2, 5.3, 5.4 and Luau
|
||||
built using full-moon. StyLua is inspired by the likes of prettier, it
|
||||
parses your Lua codebase, and prints it back out from scratch, enforcing a
|
||||
consistent code style.
|
||||
|
||||
%prep
|
||||
%autosetup -a1
|
||||
|
||||
%build
|
||||
%{cargo_build} --all-features
|
||||
|
||||
%install
|
||||
%{cargo_install} --all-features
|
||||
|
||||
%check
|
||||
%{cargo_test} --all-features
|
||||
|
||||
%files
|
||||
%{_bindir}/%{_bin_name}
|
||||
%license LICENSE.md
|
||||
%doc README.md
|
||||
|
||||
%changelog
|
10
_service
Normal file
10
_service
Normal file
@@ -0,0 +1,10 @@
|
||||
<services>
|
||||
<service name="download_files" mode="manual" />
|
||||
<service name="cargo_vendor" mode="manual">
|
||||
<param name="srctar">StyLua*.tar.gz</param>
|
||||
<param name="compression">zst</param>
|
||||
<param name="update">true</param>
|
||||
</service>
|
||||
<service name="cargo_audit" mode="manual" />
|
||||
</services>
|
||||
|
3
vendor.tar.zst
Normal file
3
vendor.tar.zst
Normal file
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:c81b9799a29c45043fe23d55a93f80f7a75992a82a2c23f44bc9c941f8e1c9cc
|
||||
size 17910629
|
Reference in New Issue
Block a user