Crates.io | code-it-later-rs |
lib.rs | code-it-later-rs |
version | 0.9.0 |
source | src |
created_at | 2020-08-06 13:39:32.730573 |
updated_at | 2024-08-25 20:32:39.30662 |
description | Filter crumbs you left in comments of code to remind where you were |
homepage | |
repository | https://github.com/ccqpein/code-it-later-rs |
max_upload_size | |
id | 273667 |
size | 87,918 |
Other Versions (have some features different):
Make flags in source code where may have problems or can be optimized. codeitlater help you track this flags and fix them in future.
cargo install code-it-later-rs
I developed the code-it-later-mode, which serves as an interface mode for my Emacs.
Languages support now:
If you wanna expand other languages, check expand json file
Write code as usual. The comment line that you want to leave mark in, left :=
symbol after comment symbol.
Then run codeitlater
command in terminal get those crumbs back.
For example:
Golang:
// /user/src/main.go
// test codeitlater
//:= this line can be read by codeitlater
//:= MARK: you can left keyword to marked comment line
/*:= mutil lines comments
*/
then run codeitlater
in code root path
You will get:
|-- /user/src/main.go
|-- Line 3: this line can be read by codeitlater
|-- Line 4: MARK: you can left keyword to marked comment line
|-- Line 5: mutil lines comments
Python:
# /src/main.py
# this line wont be read
#:= this line for codeitlater
print("aaa") ###:= this line can be read again
Run codeitlater /path/to/this_py.py
.
You will get:
|-- /src/main.py
|-- Line 3: this line for codeitlater"
|-- Line 4: this line can be read again"
Give specify file type
codeitlater -f clj
You will get result only from clojure.
codeitlater -f clj -f py
Then results both of clojure and python will return.
codeitlater -f clj -f py /path/to/file /path/to/dir
When one line ending with ...
, then, the next line will add to this crumb. Also, you can make tail chain for this.
For example:
//:= line1...
//:= , and line2...
//:= line3 with line2...
//:= line4 is diffrent...
//:= with line5
//:= line6
Will give you:
|-- Line 1: line1 , and line2 line3 with line2...
|-- Line 4: line4 is diffrent with line5
|-- Line 6: line6
Keyword format is Keyword:
with a space after.
Filter keyword (use -k be keyword flag, check out more flags by -h):
codeitlater -k MARK
You will get:
|-- /user/src/main.go
|-- Line 4: MARK: you can left keyword to marked comment line
Same format as filetypes, if you want get two keywords together:
codeitlater -k TODO --keywords MARK
CAUTION: if keywords and multi-lines are mixed, multi-lines feature has higher priority.
Example:
//:= TODO: aaaa...
//:= bbb...
//:= MARK: ccc
Both codeitlater
and codeitlater -k TODO
are showing
|-- Line 1: TODO: aaaa bbb MARK: ccc
codeitlater -k MARK
will show nothing.
This is the special feature I use in my work. For example:
//:= !JIRA-123: hello world
//:= line2
The first line "hello world" will be ignore because it start with '!'
. To show this line is give the keyword JIRA-123
like codeitlater -k JIRA-123
Or give the --show-ignored
true if you want to show everything, like codeitlater --show-ignored true
.
codeitlater -x vendor
will ignore all files in vendor (recursively).
Check tests/test.json
, if you run codeitlater -j ./tests/test.json
, the "rs" in codeitlater's dictionary will be covered by new value in test.json
. Other languages are keep same.
codeitlater
will look for {$PWD}/.codeitlater
file to pre-load arguments. If any arguments those been given in command line, also set inside the .codeitlater
file, will be rewrote by command line arguments (except ignore dirs (-x), ignore dirs configs located inside .codeitlater
file and given in command line will merge together).
codeitlater -D target
gonna clean all crumbs inside the files in the target folder. Delete will give prompt interaction, which has y/n/s/i
options. y
means delete the bread/crumbs it just shows; n
means ignore this; s
means show
, just re-print it again; i
going to interact mode, show bread one by one or crumb one by one.
You can delete special keywords with codeitlater -D -k TODO
. Generally, -D
handle after normal codeitlater
workflow done.
Like the delete feature prompt, but this feature restore the crumb left inside the code to normal comments.
//:= here
will restore to
// here
After clean some crumbs inside files, you might need some format after it. You can give the --fmt
options let codeitlater
run the command given after clean.
For example:
codeitlater -D --fmt "go fmt" .
will delete your crumbs and run the go fmt
. The command after --fmt
has to be the standalone command.
As all other options, you can add it inside the local {$PWD}/.codeitlater
.
-O/--output-format
can output the crumbs in specific format.
Support format:
Example:
codeitlater -O json .