Skip to content

Commit

Permalink
tools [nfc]: Rename directory, from scripts/
Browse files Browse the repository at this point in the history
Either name "scripts" or "tools" works well as a description for what
this directory contains: scripts we run as development tools.

When I first created it with this build-icon-font script, I chose
"scripts" for reasons of tab-completion.  Specifically, when
completing a filename to pass to `git` or `flutter test` or etc., I
wanted to preserve for the `test/` directory the privilege of being
completable after a single keystroke: "t<TAB>" completes to "test/".
After all, that's a directory one wants to talk about all the time.

The name "scripts", though, turns out to be quite unfortunate for a
different case of tab-completion: when completing a command name.
If you want to run `scripts/icons/build-icon-font`, you pretty much
have to type out "scripts/" in full.  It's competing not only with
other files in the tree, but with commands in your PATH; and my
PATH has commands "script" and "scriptreplay", as well as commands
whose names diverge from "scripts" after "s, "sc", or "scr".

That's fine when it's just about `scripts/icons/build-icon-font`,
because that's a command one runs only very infrequently.
But we're about to add an omnibus run-all-checks script; that'll
be used in CI, but I also want it to be convenient to run
frequently in local development when iterating on changes,
just as we do in zulip-mobile with `tools/test`.  To live up to
that, I want its name to be as quick and easy to type as possible.

And so, `tools/`.  Now completing "test/" for a filename will
take three keystrokes "te<TAB>" instead of two; but in exchange,
this tool-scripts directory will take only four keystrokes "too<TAB>"
to get "tools/", even when completing as a command name.
  • Loading branch information
gnprice committed Oct 3, 2023
1 parent 349b585 commit e5d1e3b
Show file tree
Hide file tree
Showing 6 changed files with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/widgets/icons.dart
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ abstract final class ZulipIcons {
// or otherwise edit the SVG files there.
// The files' names (before ".svg") should be valid Dart identifiers.
//
// * Then run the command `scripts/icons/build-icon-font`.
// * Then run the command `tools/icons/build-icon-font`.
// That will update this file and the generated icon font,
// `assets/icons/ZulipIcons.ttf`.
//
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit e5d1e3b

Please sign in to comment.