Update README.md
This commit is contained in:
25
README.md
25
README.md
@@ -4,7 +4,7 @@ would-reformat - automatic reformatting for emacs without being annoying
|
|||||||
|
|
||||||
# Installation
|
# Installation
|
||||||
|
|
||||||
- Change to the directory where you would want to use **would-reformat**:
|
- Change to the directory where you want to use **would-reformat**:
|
||||||
`$ cd ~/devel/my-project`
|
`$ cd ~/devel/my-project`
|
||||||
- From that directory, call the script `install.sh` in the directory where
|
- From that directory, call the script `install.sh` in the directory where
|
||||||
you have **would-reformat** checked out:
|
you have **would-reformat** checked out:
|
||||||
@@ -13,8 +13,8 @@ would-reformat - automatic reformatting for emacs without being annoying
|
|||||||
This will do the following:
|
This will do the following:
|
||||||
|
|
||||||
- create the directory `~/devel/my-project/bin` if it does not exist
|
- create the directory `~/devel/my-project/bin` if it does not exist
|
||||||
- create `~/devel/my-project/_reformat-common.sh`,
|
- create `~/devel/my-project/bin/_reformat-common.sh`,
|
||||||
`~/devel/my-project/do-reformat.sh`, and
|
`~/devel/my-project/bin/do-reformat.sh`, and
|
||||||
`~/devel/my-project/bin/would-reformat.sh` as symlinks to files with
|
`~/devel/my-project/bin/would-reformat.sh` as symlinks to files with
|
||||||
the same names in `~/src/would-reformat`.
|
the same names in `~/src/would-reformat`.
|
||||||
- create `~/devel/my-project/.dir-locals.el` as a symlink to the file
|
- create `~/devel/my-project/.dir-locals.el` as a symlink to the file
|
||||||
@@ -27,12 +27,27 @@ will break, so don't do that. If you rename the checkout, the symlinks will bre
|
|||||||
The directory `bin` with respect to `my-project` however is hardcoded
|
The directory `bin` with respect to `my-project` however is hardcoded
|
||||||
(enhancements here are welcome).
|
(enhancements here are welcome).
|
||||||
|
|
||||||
The script `install.sh` favors conservatism over being clever: for example,
|
The script `install.sh` favors conservatism over cleverness: for example,
|
||||||
if it finds the file `~/devel/my-project/bin/do-reformat.sh` then it
|
if it finds the file `~/devel/my-project/bin/do-reformat.sh` then it
|
||||||
checks whether it is a symlink to `~/src/would-reformat/do-reformat.sh`.
|
checks whether it is a symlink to `~/src/would-reformat/do-reformat.sh`.
|
||||||
If it is not, then it just prints a warning rather than attempting to correct
|
If it is not, then it just prints a warning rather than attempting to correct
|
||||||
the situation.
|
the situation.
|
||||||
|
|
||||||
|
# Troubleshooting
|
||||||
|
|
||||||
|
## Running prettier is slow
|
||||||
|
|
||||||
|
The scripts by default call `npx prettier` with some arguments. If you call
|
||||||
|
these scripts from a directory where there's a `node_modules/` directory with
|
||||||
|
prettier and plugins, if necessary, installed, then `npx` should be fast
|
||||||
|
enough.
|
||||||
|
|
||||||
|
The solution, therefore, seems to be to say `yarn add --dev prettier` (or
|
||||||
|
`npm install --dev prettier`) in the right place.
|
||||||
|
|
||||||
|
(This seems to work for me, but it is admittedly still uncomfortably
|
||||||
|
cargoculty. There should be a more solid basis for this answer.)
|
||||||
|
|
||||||
|
|
||||||
# Development
|
# Development
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user