diff --git a/bin/maint/mergexx b/bin/maint/mergexx index 6ce1e66ea792e624188104a0d39faa377d0cc3d9..6029c03fadec85ce434c0977df7cd708a71b7359 100755 --- a/bin/maint/mergexx +++ b/bin/maint/mergexx @@ -48,7 +48,7 @@ run_main() [ $# -ne 1 ] && _error "exactly one argument is expected." tag="$1" - if [ $(hg status | wc -l) -ne 0 ]; then + if [ $(hg status -ardm | wc -l) -ne 0 ]; then _error "uncommitted changes! Please discard or commit first." fi @@ -65,7 +65,7 @@ run_main() printf "\ncommitting with message '${msg}'...\n" hg ci -m "${msg}" || _error "failed" - printf "\nDo forget to submit the new revision!\n" + printf "\nDo not forget to submit the new revision!\n" return ${?} } diff --git a/lib/aslint/fortran/check_source.py b/lib/aslint/fortran/check_source.py index 1b377d6a1b338929ddbbef9578402ddf62afa1c6..a05873f6a8fbdada6e1318de2e97023db2129d47 100644 --- a/lib/aslint/fortran/check_source.py +++ b/lib/aslint/fortran/check_source.py @@ -15,15 +15,27 @@ from aslint.config import ASCFG from aslint.decorators import interrupt_decorator from aslint.utils import apply_in_sandbox from aslint.base_checkers import ( - Report, MsgList, CheckList, CompilMsg, + Report, MsgList, CheckList, CompilMsg, GenericMsg, call_checkers, check_file_content, check_filename, check_disabled, check_fortran_code, ) +from aslint.fortran.free.fortran_code import FortranParserError import aslint.fortran.gfortran_checkers as GFORT import aslint.fortran.static_fortran_checkers as STAT import aslint.common_checkers as COMM +class ParserMsg(GenericMsg): + """Fortran parser error + There is probably an error reported by the compiler. Otherwise, please + report this error.""" + id = 'C1011' + + def search(self, txt): + """Returns the error message""" + return [": " + txt] + + @interrupt_decorator def check_fortran_source(fname, flags, incdir, checklist, tmpdir=None): """Check a fortran source file.""" @@ -42,9 +54,12 @@ def check_fortran_source(fname, flags, incdir, checklist, tmpdir=None): lmsg.extend(check_file_content(fname, checklist.on_content())) lmsg.extend(check_fortran_code(fname, checklist.on_fortran_code())) lmsg.extend(check_filename(fname, checklist.on_filename())) - except: + except FortranParserError as exc: + checker = ParserMsg(None) + checker.check(lmsg, exc.msg) + except Exception as exc: logger.error(_("cannot check %r"), fname) - raise + raise RuntimeError(exc) check_disabled(fname, checklist, lmsg) report = Report() report.set(fname, lmsg)