Comments (4)
TL;DR: Your change is alright by me but doesn't completely solve the issue. We have to refactor the massive one-liners to really improve readability.
I agree that we have a readability problem to solve here. Personally, I like ts/sw=4, but I see the argument for using ts=2 here.
That said, I think the real fix is breaking up some of the massive one-liners. For example, the first link you included has 0 leading spaces but is still unruly to read and work with.
from zinit.
Some lines we cannot split easily without refactoring it all and possibly (probably) hurting performance. zsh expansion is powerful, but afaik there's no readable way to split these lines other than storing temporary results in a variable and doing the rest of the work in a second statement.
The best way forward here is to add a bunch of comments explaining the weirdest exps IMO. And unspaghetti what we encounter along the way. For instance I "fixed" the first example in #116:
Lines 4 to 7 in 7439160
Doing it all in one go would be a huge undertaking.
Another thing: to make things better I'm all for adopting a "return early" approach (I don't know the real tech term) ie:
Instead of:
fun() {
if check_is_okay {
long_block_of_code
return 0
} elif check_not_okay {
another_block_of_code
return 1
}
}
that:
fun() {
if check_not_okay {
another_block_of_code
return 1
}
# check is okay here
block_of_code
return 0
}
It's a poor example, but I'm sure you get my point.
Edit: It's a guard clause.
from zinit.
Doing it all in one go
Yep, minor fixes over a long period of time is alright. Any improvements > no improvements :)
from zinit.
Closing in favor of #238.
from zinit.
Related Issues (20)
- [bug]: `zinit creinstall -Q ...` or `-q` is not quiet HOT 5
- [bug]: Cannot download AppImages from gh-r?
- [bug]: zsh-autocomplete creates file called $'\374'$'\227'$'\374'$'\233'$'\374' in working directory when completing [[ with long lines in history file and terminal in 256 color mode
- [bug]: How to uninstall zinit
- [bug]: update time is incorrect
- [doc]: Update README.md and 'zinit help' with new subcommands (plugins, snippets)
- [bug]: gh-r linux wrong arch binary -- downloads aarch64 instead of x86_64 HOT 4
- [bug]: zinit should check that all persisted ices are defined during update HOT 5
- [bug]: loading plugins changes PWD HOT 1
- [bug]: Fallback command for ZINIT[LIST_COMMAND] is invalid
- [bug]: Bad math expression in `zinit plugins` on Ubuntu-22.04/WSL2 HOT 4
- [bug]: compinit security warning when installing completions from `gh-r` as root user HOT 1
- [bug]: compinit insecure directories warning can not be silenced. HOT 4
- [bug]: zinit clist -> Unknown subcommand: `clist` HOT 5
- [bug]: OMZP::aliases not functional HOT 2
- [bug]: bad cpu type for executables exa and jq HOT 3
- [bug]: Wrong binary is downloaded on a mac for eza-community/eza instead of erroring HOT 6
- [bug]: `_local` prefixed plugins incorrectly shown as unloaded in `zinit plugins` command HOT 2
- [bug]: curl: (22) The requested URL returned error: 404 HOT 2
- [bug]: `arch` binary is not available on Synology HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from zinit.