* fix(diff): add --no-pager and package header to git diff
Previously, each package's diff was shown via a separate `git diff`
invocation with Show(), allowing git to invoke its own pager (e.g. less)
independently for each package. This caused inconsistent pagination:
large diffs opened a pager, small diffs scrolled past in the terminal.
Changes:
- Add --no-pager flag to git diff so git doesn't open its own pager
per package; all diffs now stream consistently to stdout.
- Print a package name header before each diff so users can easily
identify which package each diff belongs to when reviewing multiple
packages.
Closes#1243
* bunch up diffs and render in one go
Co-authored-by: Jo Garnier <me@jguer.space>
* feat(lua): add lua-language-server type stubs for the yay global
Ship a meta/yay.meta.lua definition file that declares the `yay` global,
all yay.opt fields, and every autocmd event payload so lua-language-server
users get completion, hover docs, and typo detection without an
"Undefined global `yay`" warning.
- meta/yay.meta.lua: 232-line stub covering opt (45 fields), log, abort,
create_autocmd with per-event overloads, and 14 payload classes for the
5 autocmd events (AURPreInstall, AURPostDownload, UpgradeSelect,
PostInstall, SearchFilter). Return contracts for UpgradeSelect and
SearchFilter are annotated.
- doc/lua.md: add "Editor support" section with .luarc.json setup.
- doc/init.lua: fix PostInstall example referencing pkg.installed, a
field that does not exist on PostInstallPackage.
- Makefile: install/uninstall meta/yay.meta.lua to
$(PREFIX)/share/yay/meta/ so the documented /usr/share/yay/meta path
exists on installed systems.
Closes#2876
* doc(lua): fix api-since version to v13.0.1
* feat(lua): apply review feedback on type stubs
Type opt fields as string unions with descriptions, rename to yay.d.lua
per LuaLS docs, strip redundant comments from doc/init.lua, bump to v13.0.2.
Tested everything again: go build, go test, lua-language-server, gendocs.
* doc(lua): move "editor support", add hyperlinks
added link to `init.lua` example in "location" paragraph
having "editor support" paragraph at the very bottom of document didn't make any sense. user would want to have lsp editor support right after creating a file in config dir if ever.
removed useless paragraph about `.luarc.json` location that already been explained aboved.
added hyperlinks for luals extensions. couldn't find any special info for helix (unlike jetbrains), but it should be already covered by "other editors"
---------
Co-authored-by: danielwerg <35052399+danielwerg@users.noreply.github.com>
* fix: propagate Maintainer field through dep graph and upgrade service
Add Maintainer to InstallInfo and propagate it through the dependency
graph (dep_resolve, dep_visual) and UpgradeService. Update docs
generator with TOC support and Lua page builder.
* lint
* add upgrade hook structure
* remove extra field
* feat: Add UpgradeSelect hook logging and security example
Add yay.log API to UpgradeSelect hooks for informational and warning messages.
- Add yay.log.info() and yay.log.warn() for hook logging
- Add doc/examples/recently_modified.lua: practical example to pre-exclude
recently-modified AUR packages (supply chain attack mitigation)
- Update doc/init.lua with improved UpgradeSelect example
- Update doc/lua.md with logging API documentation
- Refactor autocmd and load modules for cleaner log integration
- Add comprehensive unit tests for logging functionality
* lint
* Add all sortyby options
Previously, only 'name' was a supported sortby option. Now, all sortby
options are supported.
Whenever there is a tie, the metric is used as a tiebreaker (it is also
the default when sortby is not specified). The only behavior that
changed is that packages with the same metric are sorted oppositely when
sorting bottomUp. This was actually a bug in the previous implementation
which inverts the `cmpResult` for bottomUp which returns true if the
metrics are the same. According to the docs for Less
(https://pkg.go.dev/sort#Interface), Less(i, i) should be false (the
same element cannot sort before itself).
I mainly structured the code for efficiency by creating the sortby
function once rather than checking `separateSources` and `bottomUp`
every comparison, but I also think this improves readability compared to
having a switch-case in the comparison function.
* Fix separating sources on ties and improve test coverage
* Remove 'id' and 'baseid' in sortby options
* add short option for --repo
* run pre-commit
* update man page
* add fish completion
* add a N options
* add long options
---------
Co-authored-by: jguer <me@jguer.space>
* feat(yay): add boolean flags
This feature now allows users to specify --<option>=<bool value> instead
of using --<option> and --no<option>. Specifying nothing results in the
boolean value being true. The flags prefixed with `no` are deprecated.
* chore(args): Print warning when using deprecated flags
* chore(yay): Update man page for deprecated options and add examples of
boolean flags being used
* feat(install): add --nocleanbuild to keep pkg/ and src/ directories for
AUR packages
Providing this flag during installation of AUR packages allows for keeping
the src/ and pkg/ directories produced my makepkg. If the user wants to
delete the directories, they can either select to cleanBuild in the
cleanmenu or run the installation without the --nocleanbuild flag (yay
will only remove the directories if the package is rebuilt)
* fix(completion): simplify description for --nocleanbuild in fish
This makes the description consistent with the descriptions in the
man page, --help, and zsh completion.
* refactor(install): Rename --nocleanbuild to --keepsrc
This naming scheme is more familiar to users since it is the name of the
flag in Paru.
---------
Co-authored-by: jguer <me@jguer.space>
* fix(alpm): fix callback text
* feat(yay): Add mixed search result
* remove old result structs
* add option for controlling query builder
* only set query builder after parsing args
* add parser args
* update manpage
* write test for results
* write test for results
* mixed source test
* only sort 1 time with every mode
fix linting errors
format with make fmt
fix completions
resolve most of the requested changes
move loop over dbSlice back into makeRequest
query aur in chunks of 20
check for status codes
continue instead of return in for loop
format code
tar is slower and harder to diff. I doubt any one still uses it intentially.
There's a chance some people have not cleared their cache in two years
and still have tar based packages around. But forcing them to clear
their cache is not a big deal at all.