Commit Graph
144 Commits
Author SHA1 Message Date
Joey Holtzman 19a67d1dbd Add contextual help to Yay operations (#2921)
Instead of `yay -<op> --help` printing the entire help message, it will
now print a contextual help message based on the operation being
performed. The top-level help message shows available operations and
global flags as before. It no longer shows operation-specific flags and
`pacman -S --help` output. Like the pacman output, it shows that you can
get operation-specific help by running `yay -<op> --help`.

The operation-specific help message shows the operation's flags and all
pacman operation flags pass through to pacman.
2026-07-31 03:04:39 +09:00
github-actions[bot]andJo Garnier 45964c4b42 [repo-assist] fix(diff): add --no-pager and package header to git diff (#1243) (#2905)
* 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>
2026-07-19 02:23:09 +02:00
Jo 4869306719 feat(search): implement render-hooks for search (#2896)
* add render hooks

* re-render hook per event

* add example with single_line and simplify built rendering

* update docs availability

* remove comments
2026-07-06 14:15:57 +02:00
Jo d72402292e feat(lua): allow configuring answer menus and minor fixes to examples (#2880)
allow configuring answer menus and minor fixes to examples
2026-06-19 14:31:43 +02:00
Jo 88c72b32b1 fix(lua): change search paths to resolve lua modules in config dir (#2879)
change search paths to not resolve lua modules in cwd but in the config dir
2026-06-19 12:04:12 +02:00
Jo 70d7a0f0a8 fix(lua): Reduce event size of PostInstall and SearchFilter hooks (#2871)
* remove fields from events that might not be needed yet

* reduce event size
2026-06-17 21:40:02 +02:00
Jo 15057c8dab misc(ci): add modernize linter and update versioning (#2870)
* add modernize linter

* lint unused

* update imports

* ignore agent info
2026-06-17 21:09:53 +02:00
Jo df4cbc4ce4 fix(log): fix debugln not spacing args correctly (#2869)
* fix debugln not spacing args correctly

* fix tests
2026-06-17 20:39:24 +02:00
Jo 3b3a2b1dcc fix: search filter hooking and multierror cleanup (#2868)
* fix search filtering pass along

* prepare inclusion 'modernize' linter and use errors.join instead
2026-06-17 19:34:33 +02:00
Jo 4dbf124c51 feat(lua): add search filter and post install hooks (#2867)
* search filter and post install

add examples

* add tag
2026-06-16 23:35:18 +02:00
Jo 1ec6f3f793 feat: expose AUR package maintainer to upgrade hooks (#2858)
lint
2026-06-15 22:07:49 +02:00
Jo 16479dcaf3 feat: Add AURPostDownload hook (#2856)
* run hooks after source download

* lint

* nitpick: remove event table indirection
2026-06-15 18:10:41 +02:00
Jo 421b65bf43 feat: Add UpgradeSelect hook, logging and security example (#2855)
* 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
2026-06-15 15:25:40 +02:00
Jo 1501438fba AUR: Add AURPreInstall hooks (#2854)
* add lua hooks on aur package installs

* add abort command to differentiate errors and aborts

* u
2026-06-15 13:31:13 +02:00
Jo ecae3e601e Add Lua configuration support (#2845)
* lua opt trial

* go mod tidy
2026-06-09 00:31:26 +02:00
Jo ac83d3fb06 Switch to JaroWinkler distance and reweight package search scores (#2840)
fix(query): use JaroWinkler distance and reweight metric components

Switch from Hamming to JaroWinkler distance for package name matching,
as JaroWinkler handles variable-length strings and gives a prefix-match
bonus better suited to package search.

Reweight the score components from sim*0.50 + simDesc*0.20 + popularity*0.30
to sim*0.35 + simDesc*0.15 + popularity*0.50 to better surface popular
packages when name similarity is moderate.

Roll back the unreleased version target from 13.0.0 to 12.6.0 to align
with the next minor release after v12.5.7.

Fix scanner.Err() check in parseStdin to surface I/O errors that were
previously silently dropped.
2026-06-07 18:16:46 +02:00
Jo 50c8291a1e Revert: ini addition to figure out a better customizable system (#2836)
* Revert "feat(ini): support ini config (#2774)"

This reverts commit 3e3d5aa111.

* use base-devel

* fix lint

* fix lint

* fix lint
2026-06-06 23:56:45 +02:00
Jo 3b79933638 test: harden coverage and make tests parallel-safe (#2797)
* Test coverage hardening and parallel-safe refactors

Add focused test coverage for under-tested operational paths, edge branches,
and make key table-driven suites parallel-safe. Also fixed flaky installer
test execution under repeated/parallel runs.

* chore: fix goimports ordering for golangci-lint

* Test(download): expand integration coverage for download paths

Add integration scenarios for force/pull repo updates, repo-only and skip semantics,
and direct AUR download/scanner coverage used by getpkgbuild and package preparation.

* Test(exe): relax systemd-run path assertion

Fix flaky TestBuildGitCmd by accepting an absolute systemd-run path while still
asserting the expected binary is used.

* Test(text): avoid race in color tests

Remove parallel execution from TestColorHash so global UseColor writes do not
overlap with color consumers in parallel tests and trigger race detector
failures.

* fix potential race conditions
2026-03-25 00:51:34 +01:00
Jo 90ae08862a Remove timeupdate option (#2796)
* disable provides by default

* remove time update due to low usage
2026-03-18 23:01:14 +01:00
b09f3de913 ci: update golangci-lint to v2.10.1 and bump Go to 1.26 (#2791)
* Initial plan

* ci: update golangci-lint to v2.10.1 and use go 1.26

Co-authored-by: Jguer <8071073+Jguer@users.noreply.github.com>

* fix false report lints

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: Jguer <8071073+Jguer@users.noreply.github.com>
Co-authored-by: Jo Garnier <git@jguer.space>
2026-03-08 23:33:23 +01:00
JoandCopilot 3e3d5aa111 feat(ini): support ini config (#2774)
* support ini config

* support user ini config

* Update pkg/settings/ini.go

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2026-01-30 16:07:24 +01:00
Jo b2dfa0c56f chore(migration): default to "" as sortBy to keep existing behavior (#2768)
* bump builtin version

* add sortby migration to keep current user behavior
2026-01-22 10:28:47 +01:00
Jo 81440e54a4 chore(go): modernize syntax (#2672)
* modernize go syntax

* fix lint
2025-09-18 18:05:58 +02:00
given fd62f7f4c8 catch incompatible --clean flag when no operation is specified with better error message (#2644)
* improve error messaging when running yay -c

* use correct method in parsing -c flag

* better express prefixes in --help
2025-07-18 14:04:28 +02:00
Eisuke KawashimaandEisuke Kawashima f1391b3e03 feat: add run0 for privilege elevator (#2637)
Co-authored-by: Eisuke Kawashima <e-kwsm@users.noreply.github.com>
2025-07-08 15:08:55 +02:00
Jo b745f87210 chore(ci): update golangci lint v2.1.5 (#2615)
* chore(ci): update golangci-lint to v2.1.5 in ci.Dockerfile

* add golangci

* fix lint

* fix lint pkg/upgrade

* reenable lint
2025-05-01 10:00:10 +02:00
Jo 89b32ee9ce fix(parser): allow disable-sandbox option. fixes #2509 (#2511) 2024-09-24 08:12:41 +00:00
Daniel Ohandjguer 836fc5922a add short option for --repo (#2380)
* 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>
2024-06-28 16:40:35 +02:00
Joey Holtzman d02c45e5b6 Remove deprecated flags in favor of boolean flags (#2350) 2024-01-25 16:03:47 +01:00
Joey Holtzman d368f99be0 feat(yay): add boolean flags (#2285)
* 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
2023-09-27 12:36:57 +02:00
Jo 299aa1e123 fix(download): do not garble download output by default (#2283)
limit default concurrent downloads to 1
2023-09-18 09:51:32 +02:00
Joey Holtzmanandjguer 04c76a404e feat(install): add --keepsrc to keep pkg/ and src/ directories (#2272)
* 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>
2023-09-18 09:21:42 +02:00
Jo 8916cd174b refactor(yay): move cfg inside of runtime (#2259)
* rework relationship between runtime and cfg

* separate runtime from cfg

* simplify instantiation logic

* move installer to appropriate package

* move operator to sync package

* add tests for srcinfo service

* consolidate srcinfo service in sync

* add logger to srcinfo

* add logger to preparer

* remove unused text functions

* remove remaining text.* from srcinfo

* remove global logger parts

* remove global org method exports

* remove global logger

* move text->input

* add rule to prevent fmt.Print

* update golangci go version

* remove outdated FAQs

* remove outdated FAQs
2023-08-06 21:39:41 +02:00
smolx adde043514 Add --askyesremovemake option (#2199)
Same as --askremovemake option but with "Y" as a default answer.
2023-06-11 16:13:01 +00:00
smolx 0607090719 Fix deps resolving for installs from SRCINFO (#2190)
Also made MockBuilder and MockRunner thread-safe.
2023-06-03 13:53:33 +00:00
Jo e28319fece chore(yay): lift legacy engine (#2189)
* remove legacy engine

* remove legacy dep handlers

* use prepare for gendb

* remove unused method

* remove aur client old interface

* remove unused menu fns

* remove inactive upgrademenu option

* unexport printInfo
2023-05-24 08:22:18 +00:00
smolx 56d1b7ed1c Fix --rebuild option (#2163)
* Reimplement --rebuild option in the new engine (#2153)

* Refactor --rebuild option

* Fix comment formatting
2023-05-23 21:16:27 +00:00
Jo fdcf6ef664 ci(yay): add integration test framework (#2178)
* add integration test framework

* fix integration tests

* fix integration tests
2023-05-22 21:38:02 +00:00
Jo d568a73ab8 fix(metadata): reduce cache validity (#2161)
fix metadata cache validity too long
2023-05-15 08:30:41 +00:00
Jo 49267b9cd9 feat(upgrade): separate menu for pulled along dependencies (#2141)
try separate menu for pulled along

use installed as term

fix order gap

fix tests

add aur db + aur scenario
2023-04-27 07:20:21 +00:00
Jo 88008e4eb3 feat(yay): skip confirmed confirms (#2107)
* skip pacman confirmations when yay confirmations are done

* default to double confirm

* fix tests
2023-04-11 11:51:39 +00:00
Jo c7a51a1614 fix(text): ensure error logs go to stderr (#2105)
ensure Error logs go to stderr
2023-04-10 16:26:09 +00:00
Jo ce0cb35510 feat(new_engine): add support for --nocombinedupgrade (#2083)
* feat(new_engine): add support for --nocombinedupgrade

* update en.po
2023-04-06 11:54:03 +00:00
Jo 7bc4a666e6 refactor(runtime): Build runtime after cmdargs parsing (#1965)
* extract runtime building from cfg

* respect AURRPCURL

* use -Syu if there are no targets, allows to pass extra options

* one more step towards removing runtime from cfg
2023-03-13 08:48:39 +00:00
Jo f11f9058c2 fix(logger): respect --debug for setting debug logger (#1955)
respect --debug parse
2023-03-08 21:33:43 +00:00
Jo 3d5a43c294 chore(yay): bump version (#1949)
bump major
2023-03-07 21:04:06 +00:00
Jo 463e60e045 chore(deps): update goalpm (#1947)
* update dependencies

* use logger in cmd runner
2023-03-06 09:19:21 +00:00
Jo fa2e726ca6 chore(text): use logger in new engine services (#1939)
* use logger in vcs

* use logger in query builder

* use logger in migrations
2023-02-25 19:03:27 +00:00
Jo 61f1bdf291 fix(cmd): propagate sigterm to spawned processes (#1927)
propagate sigterm to spawned processes
2023-02-21 02:49:33 +00:00
Jo 7c8f273cdf fix(git): add git denylist for workspace variables (#1926)
add git denylist for workspace variables
2023-02-21 02:23:48 +00:00