Commit b737c559 authored by Kevin Modzelewski's avatar Kevin Modzelewski

Add some notes about formatting

parent daefbbb6
......@@ -4,7 +4,15 @@
Before a pull request can be merged, you need to to sign the [Dropbox Contributor License Agreement](https://opensource.dropbox.com/cla/).
Please make sure to run the tests (`make check`) on your changes.
Please make sure to run the tests (`make check` and `make check_format`) on your changes.
##### Formatting
Please make sure `make check_format` passes on your commits. If it reports any issues, you can run `make format` to auto-apply
the project formatting rules. Note that this will format your files in-place with no built-in undo, so you may want to
create a temporary commit if you have any unstaged changes.
### Projects
If you don't know where to start:
- Check out the list of [starter projects](https://github.com/dropbox/pyston/wiki/Starter-projects)
......
......@@ -309,7 +309,8 @@ endef
format:
find \( -name '*.cpp' -o -name '*.h' \) -print0 | xargs -0 $(LLVM_BIN)/clang-format -style=file -i
check_format:
$(TOOLS_DIR)/check_format.sh $(LLVM_BIN)/clang-format
$(ECHO) checking formatting...
$(VERB) $(TOOLS_DIR)/check_format.sh $(LLVM_BIN)/clang-format
.PHONY: test test_debug test_prof test_release
test_debug: pyston_dbg ext
......
#!/bin/bash
set -eu
failed=0
for fn in $(find -name '*.cpp' -o -name '*.h'); do
$1 -style=file -output-replacements-xml $fn | grep -q "replacement offset" && { echo $fn "failed clang-format check"; exit 1; }
$1 -style=file -output-replacements-xml $fn | grep -q "replacement offset" && { echo $fn "failed clang-format check"; failed=1; }
done
echo "Format checks passed"
exit 0
if [ $failed -eq 0 ]; then
echo "Format checks passed"
exit 0
else
exit 1
fi
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment