Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some clean ups, fixes, config flag #91

Merged
merged 13 commits into from
May 10, 2023
Merged

Some clean ups, fixes, config flag #91

merged 13 commits into from
May 10, 2023

Conversation

coastalwhite
Copy link
Contributor

This PR cleans up some aspects of the configuration management. It also implements #84. This also fixes the long form page width flag, which was previously broken.

@trimental
Copy link
Collaborator

This changes look good to me. I'll let @CosmicHorrorDev give the final review since this mainly touches upon the code he has written.

@CosmicHorrorDev
Copy link
Collaborator

I'll give it a look after I'm off work!

Copy link
Collaborator

@CosmicHorrorDev CosmicHorrorDev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a few small nits, but otherwise looks great 👍

This looks like three changes in a trenchcoat, so I'll address each in turn


Fixing the broken page width flag

Yikes, good find! I'll add a regression test to make sure that it actually gets tested for parsing in a follow-up PR


Various cleanups

I really appreciate all the changes. Everything seemed great to me!


Adding a --config flag

I see that this dropped modifying default values for clap's help text with values from the config. Technically we could still manage it by trying to parse args -> reading the config file -> actually parse the args, but a) I don't think that's worth the effort and b) I don't even think the original implementation before this PR was worth the effort. It gets a goodbye and good riddance from me 😁


Overall I love the changes! Thanks for the PR

src/keybindings/defaults.rs Outdated Show resolved Hide resolved
src/keybindings/mod.rs Outdated Show resolved Hide resolved
src/opts/config.rs Outdated Show resolved Hide resolved
src/opts/mod.rs Outdated Show resolved Hide resolved
src/opts/cli.rs Outdated Show resolved Hide resolved
src/opts/cli.rs Outdated Show resolved Hide resolved
@CosmicHorrorDev CosmicHorrorDev linked an issue May 8, 2023 that may be closed by this pull request
@coastalwhite
Copy link
Contributor Author

I will have a look at this tonight

@CosmicHorrorDev
Copy link
Collaborator

I'll take a look when I'm on my lunch break in about half an hour

Copy link
Collaborator

@CosmicHorrorDev CosmicHorrorDev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for all the changes, everything looks great!

@CosmicHorrorDev CosmicHorrorDev merged commit 76f3db9 into Inlyne-Project:main May 10, 2023
@coastalwhite coastalwhite deleted the clean-up branch May 10, 2023 21:09
CosmicHorrorDev pushed a commit to CosmicHorrorDev/inlyne that referenced this pull request Nov 19, 2023
* Refactor: Remove unneccesary CLI branching

* Refactor: Refactor configuration load function

* Feat: Add '--config' flag

* Refactor: Reduce passing of args and configuration

* Fix: Fix cli parsing of page width

* Clean: use 'display()' instead of debug print for path

* Clean: use Default for Keybindings

* Refactor: Use Keybindings in tests

* Doc: Fix 'page width' to 'page_width'

* Refactor: use interpolation style

* Refactor: Remove inline on Keybindings::new

* Refactor: Extract Keybindings Default implementation

* Refactor: Destructure Config and Args in opts
@CosmicHorrorDev CosmicHorrorDev mentioned this pull request Nov 19, 2023
8 tasks
CosmicHorrorDev added a commit that referenced this pull request Nov 23, 2023
* Some clean ups, fixes, config flag (#91)

* Refactor: Remove unneccesary CLI branching

* Refactor: Refactor configuration load function

* Feat: Add '--config' flag

* Refactor: Reduce passing of args and configuration

* Fix: Fix cli parsing of page width

* Clean: use 'display()' instead of debug print for path

* Clean: use Default for Keybindings

* Refactor: Use Keybindings in tests

* Doc: Fix 'page width' to 'page_width'

* Refactor: use interpolation style

* Refactor: Remove inline on Keybindings::new

* Refactor: Extract Keybindings Default implementation

* Refactor: Destructure Config and Args in opts

* Support bare relative links (#103)

* Attempt to reregister file watcher on file "removal" (#106)

* Add a test for all CLI options (#116)

* Add repology badge for package manager installation (#109)

* Make correct location of `inlyne.toml` file clearer (#122)

* Make correct location of `inlyne.toml` file clearer

* Fix missing backtick

* Interpreter testing (#132)

* Interpreter test tweaks (#138)

* Cleanup existing custom debug impls

* Add custom debug impls for `Element::Image(_)`

* Add a snapshot test for complex image elements

* More robust file watching (#147)

* The watcher should attempt to re-register on name changes

* Re-register watcher after longer delays

* Add a reminder for fixing watching after file changes

* Move file watcher into its own file

* Make file watcher testable

* Watcher follows file changes

* Test the file watcher

* Final test tweaks

* Swap back to the old delays

* Final final test tweaks

* Use a slightly longer delay

* Shorter poll interval for file watcher

* Follow through with rename

* Make file reloading less panic happy (#145)

* Rework panic happy file reloading

* Tweak logs

* The watcher should attempt to re-register on name changes

* Re-register watcher after longer delays

* Improve syntax highlighting (#150)

* Add failing test

* Use extended syntax definitions

* Add failing test

* Allow for comma as an info string delimiter

* Retry watcher test with increased delays (#155)

* Fix-up nested lists (#154)

* Add failing tests

* Handle nesting of lists

* Cleanup list prefix handling

* Dogfood new `smart-debug` crate (#156)

* Dont ignore locked mutex in debug impl (#166)

* fix: add missing `fontdb` feature flag (#169)

This solves an issue with the NixOS build where fonts are required at
runtime for inlyne to start. With the `fontconfig` feature flag inlyne
will use font-config to determine a font.

Partially resolves #164

* Add relevant keywords to `Cargo.toml` (#171)

* Use `human-panic` for a custom panic hook (#172)

* Use `human-panic` for a custom panic hook

* Indicate that the version is a "git release"

* `cargo upgragde`

* Update `two-face`

* `cargo update`

* Update simple dependencies

* Update `smart-debug`

* Update `resvg` & co.

* Update `rust-version` to v1.70.0

* Bump version to v0.3.2

---------

Co-authored-by: Gijs Burghoorn <g.burghoorn@gmail.com>
Co-authored-by: Nico Burns <nico@nicoburns.com>
Co-authored-by: AlphaKeks <85143381+AlphaKeks@users.noreply.github.com>
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.

Allow for flag to overwrite config location
3 participants