Skip to content

rewrite Rust (hyprlang-rs)#3

Closed
RAprogramm wants to merge 71 commits intoHyDE-Project:devfrom
RAprogramm:2
Closed

rewrite Rust (hyprlang-rs)#3
RAprogramm wants to merge 71 commits intoHyDE-Project:devfrom
RAprogramm:2

Conversation

@RAprogramm
Copy link
Collaborator

Closes #2

@RAprogramm
Copy link
Collaborator Author

Tested against HyDE scripts compatibility.

Fixed issue: Source paths with inline comments were not parsed correctly, causing the -s flag to fail. Example:

source = $HOME/.local/share/hyde/hyprland.conf # Fallback

Tested all variables from HyDE configuration.py:

$ hydequery ~/.config/hypr/hyprland.conf -s \
  -Q '$GTK_THEME' \
  -Q '$ICON_THEME' \
  -Q '$CURSOR_THEME' \
  -Q '$CURSOR_SIZE' \
  -Q '$COLOR_SCHEME'

Wallbash-Gtk
Tela-circle-dracula
Bibata-Modern-Ice
24
prefer-dark

Export formats work correctly:

env format (for shell scripts):

$ hydequery ... --export env
GTK_THEME="Wallbash-Gtk"
ICON_THEME="Tela-circle-dracula"

Nested config values:

$ hydequery ~/.config/hypr/hyprland.conf -s \
  -Q 'general:border_size' -Q 'decoration:rounding'
2
3

All HyDE theme variables are accessible through the main hyprland.conf with -s flag. Ready for integration with configuration.py.

Added comprehensive tests with real HyDE config examples:
- export.rs: 100% coverage
- source.rs: 96% coverage
- value.rs: 98% coverage
- query.rs: 97% coverage
- schema.rs: 96% coverage
- path.rs: 96% coverage

Integration tests cover real HyDE scenarios:
- Theme variables (GTK_THEME, ICON_THEME, CURSOR_SIZE)
- General settings (gaps, border_size, rounding)
- Source directive chaining
- Decoration and animation configs
Separated Args::parse() from main logic to enable comprehensive testing.

Coverage improved from 74% to 86%:
- app.rs: 93% (was 44%)
- Core business logic fully covered

Added 30+ tests for run_with_args covering:
- Theme variables (GTK_THEME, ICON_THEME, CURSOR_SIZE)
- General/decoration settings
- Source directive following
- Type and regex filters
- Error cases (missing vars, invalid paths)
- Export formats (json, env, plain)
…ages

- Make config_file optional to allow --fetch-schema standalone
- Add validation_error for clear user feedback
- Fix error display to show actual message instead of error kind
- Update help and man page to reflect new CLI patterns
- Fix ASCII art to spell HYDEQUERY instead of HYPRQUE
- Add filters.rs and defaults.rs to architecture section
- Add --get-defaults example
- Clarify that -Q is not required for all operations
- Add benchmarks for query parsing (simple, typed, regex)
- Add benchmarks for file I/O operations
- Add benchmarks for full query execution
- Add lib.rs to expose modules for benchmarking
- Add Clone derive to Args for benchmark iterations
- Fix doctests in fetch.rs
@RAprogramm
Copy link
Collaborator Author

  • Query parsing: ~40-100ns
  • File I/O: ~4µs

- Add cliff.toml configuration for conventional commits
- Add changelog CI job that runs on push to main
- Generate initial CHANGELOG.md from commit history
- Configure commit message parsing for features, fixes, docs, etc.
- Configure weekly dependency checks for Cargo and GitHub Actions
- Group all minor/patch updates into single PRs by ecosystem
- Auto-merge and auto-approve minor/patch updates after CI passes
- Use squash merge for clean history
@RAprogramm
Copy link
Collaborator Author

@kRHYME7, i'm think i'm done) let's check this stuff!

i'll add benchmark section in readme later

@kRHYME7
Copy link
Collaborator

kRHYME7 commented Nov 23, 2025

@RAprogramm can you name the binary hyq as analogous to jq and yq ? also call it hyprquery please. Thank you!

@RAprogramm
Copy link
Collaborator Author

@kRHYME7 works good?

@RAprogramm
Copy link
Collaborator Author

@RAprogramm can you name the binary hyq as analogous to jq and yq ? also call it hyprquery please. Thank you!

So how it could be?
Hyq instead of hydequery?
Where I have to change?

@kRHYME7
Copy link
Collaborator

kRHYME7 commented Nov 23, 2025

hyq for the binary executable name.
hyprquery for the whole package name.

hyprquery because it can be a stand alone tool to parse hypr configs.

@RAprogramm
Copy link
Collaborator Author

Got you!

@prime-run prime-run changed the title 2 rewrite Rust (hyprlang-rs) Nov 23, 2025
@prime-run
Copy link
Collaborator

prime-run commented Nov 23, 2025

@RAprogramm would you mind pushing this against an empty experimental/dev branch ?
would be way easier to colab on.

edit: jsut for the sake of diffing rs files against rs file!

@RAprogramm RAprogramm changed the base branch from main to dev November 24, 2025 00:19
@RAprogramm
Copy link
Collaborator Author

@RAprogramm would you mind pushing this against an empty experimental/dev branch ? would be way easier to colab on.

edit: jsut for the sake of diffing rs files against rs file!

@prime-run dev branch created, bro! yes, it's a good practice to protect main/master branch

@RAprogramm
Copy link
Collaborator Author

@kRHYME7 , done, renamed to hyq and hyprquery

@prime-run
Copy link
Collaborator

prime-run commented Nov 24, 2025

@RAprogramm

cool, I clean up dev branch. would be great if you deal with conflicts. then we merge and take from there.

P.S maybe keep that warning I added on top of the README.md ?!

edit: let me squash everything in dev too.

@prime-run
Copy link
Collaborator

@RAprogramm Alright, we have a clean history under dev now. I force pushed from an orphan branch so github automatically closed this PR.
You can fetch and cherry pick your commits and force push against dev (or just copy files over and commit all at once XD up to you ).
Sorry for the trouble but I think this is the cleanest way.

@prime-run
Copy link
Collaborator

@RAprogramm I did the cherry picking and pushed to hdev branch

Would be great if you could confirm your commit history there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feature: I think it is more convenient to use https://github.com/spinualexandru/hyprlang-rs

4 participants