forked from pool/StyLua
* 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
56 lines
1.7 KiB
RPMSpec
56 lines
1.7 KiB
RPMSpec
#
|
|
# 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
|