Compare commits
3
Commits
f76918b675
...
17e4e8974e
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
17e4e8974e | ||
|
|
5c83cea036 | ||
|
|
b973d61038 |
@@ -1,32 +1,10 @@
|
|||||||
cc-clean(){
|
|
||||||
rm -rf ./**/*.out 2>/dev/null
|
|
||||||
}
|
|
||||||
|
|
||||||
# compile and run a single C program. Useful for prototyping.
|
|
||||||
cc-run(){
|
|
||||||
local file
|
|
||||||
if [ -z "$1" ]; then
|
|
||||||
echo "Usage: cc-run <file> [args...]" >&2
|
|
||||||
return 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
file="$1"
|
|
||||||
shift
|
|
||||||
|
|
||||||
gcc "${file}" -o "${file}.out" -Wall -Wextra -Werror -g3 -fsanitize=address $@ && \
|
|
||||||
"./${file}.out"
|
|
||||||
|
|
||||||
rm "${file}.out"
|
|
||||||
}
|
|
||||||
|
|
||||||
# https://pypi.org/project/c-formatter-42/
|
# https://pypi.org/project/c-formatter-42/
|
||||||
# install via
|
# install via
|
||||||
# pip3 install --user c-formatter-42
|
# pip3 install --user c-formatter-42
|
||||||
norm(){
|
normify(){
|
||||||
c_formatter_42 *.c *.h
|
c_formatter_42 *.c *.h
|
||||||
}
|
}
|
||||||
|
|
||||||
pcheck(){
|
pcheck(){
|
||||||
flake8 . && echo "flake good"
|
flake8 --color=never . && echo "flake8 OK" && mypy --strict .
|
||||||
mypy --strict .
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,6 +4,9 @@
|
|||||||
explicit-shell-file-name "/bin/bash"
|
explicit-shell-file-name "/bin/bash"
|
||||||
shell-command-switch "-ic")
|
shell-command-switch "-ic")
|
||||||
|
|
||||||
|
;; Start the compile prompt with an empty command.
|
||||||
|
(setq-default compile-command "")
|
||||||
|
|
||||||
;; Disable auto-save files (#file#).
|
;; Disable auto-save files (#file#).
|
||||||
(setq auto-save-default nil)
|
(setq auto-save-default nil)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user