* docs: add toc to CODE OF CONDUCT
* chore: add prettier ignore blocks to docs
* chore: update styles for Dockerfile
* refactor: separate prettier, doctoc
This does a couple things:
- update `.prettierignore`
- split `prettier` and `doctoc` commands. you can still run with `yarn
fmt`
- delete `fmt.sh` and add `doctoc.sh`
By doing so, we can run tasks in parallel in CI and we should also have
less false positives than before with `yarn fmt` locally.
* refactor: update prettier job, add doctoc
This modifies the prettier job to use actionsx/prettier. It also adds a
job for `doctoc`.
* chore: upgrade to prettier 2.7.1
* chore: pin doctoc to 2.0.0
* fixup!: add .pc to prettierignore
* feat: add --cache to prettier cmd
* Check the logged user instead of $USER
Given that `sudo usermod --login "$DOCKER_USER" coder` and `sudo groupmod -n "$DOCKER_USER" coder` modify the container's disk it'll persist across restarts, but environment variables will be reset to whatever state they had at the end of `Dockerfile`. In this case, `$USER` is set to `coder`, so this branch will always be true.
By checking with the output of `whoami`, which gets it's information from `/etc/passwd`, we make sure to get the real logged user and not the one defined by $USER.
We also move `USER="$DOCKER_USER"` out of the branch, since we always want this to happen at entry-point. If we don't do this assignment, $USER will contain `coder` upon restart.
* Update entrypoint.sh
Check `$DOCKER_USER` was defined before copying it to `$USER`.
If do not update the UID within the passwd database to match whatever
uid the container is being ran as, then sudo will not work when renaming
the user to match $DOCKER_USER as it will complain about the current
user being non-existent.
We do not try renaming $HOME anymore as there is no good way
to do it.
We also only try to convert if the user hasn't been changed.
Finally I added usage to the docker docs in install.md
Closes#2056