Skip to content

Commit

Permalink
- bring back the coding style targets and the aspell file
Browse files Browse the repository at this point in the history
  • Loading branch information
adrpo committed May 12, 2015
1 parent b89833d commit 6092981
Show file tree
Hide file tree
Showing 3 changed files with 78 additions and 1 deletion.
3 changes: 2 additions & 1 deletion .gitignore
Expand Up @@ -11,4 +11,5 @@ install-sh
.metadata/
.externalToolBuilders/
.project-sample
.project
.project
.openmodelica.aspell
38 changes: 38 additions & 0 deletions .openmodelica.aspell
@@ -0,0 +1,38 @@
personal_ws-1.1 en 34
subscripted
UTF
RML
polymorphism
SIunits
MetaModelica
MSL
OpenModelica
lookup
redeclared
elsewhen
reinit
subtypeof
checkModel
matchcontinue
sqrt
uniontype
subtype
builtin
redeclaration
rhs
tuple
Jacobian
instantiation
vectorize
MODELICAPATH
der
initializer
redeclare
Modelica
lhs
CN
classDirectory
DAE
FMU
overconstrained
GC
38 changes: 38 additions & 0 deletions Makefile.in
Expand Up @@ -22,6 +22,44 @@ omnotebook: omplot
testsuite-depends:
$(MAKE) --quiet -C testsuite "OMBUILDDIR=@OMBUILDDIR@" CC="@CC@" CFLAGS="@CFLAGS@" omc-diff ReferenceFiles

SOURCE_DIRS_UTF8=OMEdit/ OMShell/ OMNotebook/ OMOptim/ OMPlot/ OMCompiler/Compiler/ OMCompiler/SimulationRuntime/ `bash -c echo testsuite/flattening/libraries/3rdParty/{PlanarMechanics,siemens,SiemensPower,ThermoSysPro}` testsuite/openmodelica/modelicaML testsuite/AVM testsuite/simulation
SOURCE_DIRS=$(SOURCE_DIRS_UTF8) testsuite/flattening/libraries/3rdParty/HumMod

bom-error:
rm -f bom-error.log bom-error.sh
echo "#!/bin/sh\ntest \"\`head -c3 \\\"\$$1\\\"\`\" = \"\`/bin/echo -ne \"\\xef\\xbb\\xbf\"\`\" && (echo \$$1 contains BOM >> bom-error.log)" > bom-error.sh
find $(SOURCE_DIRS) -type f \( ! -path '*/.svn/*' -or -path '*/.git/*' -prune \) \( ! -path 'libraries/Modelica 3.2.1/*' -prune \) -exec sh bom-error.sh "{}" ';'
@if test -e bom-error.log; then cat bom-error.log; fi
@test ! -e bom-error.log
rm -f bom-error.log bom-error.sh

tab-error:
! find $(SOURCE_DIRS) -regextype posix-egrep -regex '.*\.(cpp|c|h|mo|tpl)$$' -exec echo -n "{} " ';' -exec grep -c " " '{}' ';' | \
grep -v " 0\$$" | egrep -v '/GenTest/|/antlr-3.2/|Parser/MetaModelica_|Parser/ParModelica_|Parser/Modelica_3_|Parser/ModelicaParser'
# Trims trailing whitespace and replaces tabs with spaces
fix-whitespace:
find . -type f \( ! -path '*/.svn/*' -or -path '*/.git/*' -prune \) -regextype posix-egrep -regex '.*\.(cpp|c|h|mo|tpl)$$' -exec sh -c 'sed -i -e "s/ / /g" -e "s/ *\$$//" "{}"' ";"

spellcheck:
grep -oE 'gettext[(]["]([^"]|([\\]["]))*["]' `ls Compiler/*/*.mo | grep -v Flags.mo` | sed "s/[\\%]./ /g" | aspell -p ./.openmodelica.aspell --mode=ccpp --lang=en_US list | sort -u | sed 's/^/aspell: /' | tee aspell.log
@test ! -s aspell.log
thumbsdb-error:
! find . -name "Thumbs.db" | grep Thumbs.db

utf8-error:
rm -f utf8-error.log*
find $(SOURCE_DIRS_UTF8) -regextype posix-egrep -regex '.*\.(cpp|c|h|mo|tpl)$$' -exec bash -c "iconv -f UTF-8 -t UTF-8 '{}' -o /dev/null 2>utf8-error.log2 || (echo -n '{}: ' && head -n1 utf8-error.log2)" ';' 2>&1 > utf8-error.log
# Also detect some valid UTF-8 that were obviously fracked up by Eclipse on Windows.
find $(SOURCE_DIRS_UTF8) -regextype posix-egrep -regex '.*\.(cpp|c|h|mo|tpl)$$' -exec bash -c "grep 'Link[^A-Za-z0-9_,.;&-]*ping' '{}' | grep -v Linköping && (echo '{}: Failed Linköping test')" ';' 2>&1 >> utf8-error.log
@cat utf8-error.log
@test ! -s utf8-error.log
rm -f utf8-error.log*

utf8-iconv:
rm -f tmp
find $(SOURCE_DIRS) -regextype posix-egrep -regex '.*\.(cpp|c|h|mo|tpl)$$' -exec bash -c "iconv -f UTF-8 -t UTF-8 '{}' -o /dev/null 2>tmp || (rm -f tmp && cp '{}' tmp && iconv -f ISO-8859-1 -t UTF-8 tmp -o '{}' && echo Converted {} to UTF-8)" ';'
rm -f tmp

clean:
test ! -d build || rm -r build/

Expand Down

0 comments on commit 6092981

Please sign in to comment.