|
58 | 58 |
|
59 | 59 | if [[ $do_modified = false ]]; then |
60 | 60 | extra[${#extra[@]}]="${basedir}/configure.ac" |
61 | | - extra[${#extra[@]}]="${basedir}/python/plumed.pyx" |
62 | 61 | fi |
63 | 62 | if [[ $do_modified = false ]] && [[ $do_local == false ]]; then |
| 63 | + #plumedcheck will call "cython" this check may give some problems if you use pyenv |
| 64 | + if which cython &> /dev/null; then |
| 65 | + extra[${#extra[@]}]="${basedir}/python/plumed.pyx" |
| 66 | + fi |
64 | 67 | extra[${#extra[@]}]=--global-check |
65 | 68 | fi |
66 | 69 | # shellcheck disable=SC2086 |
67 | 70 | "${basedir}/src/maketools/plumedcheck" \ |
68 | 71 | --astyle="${basedir}/astyle/astyle" \ |
69 | 72 | --astyle-options="${basedir}/.astyle.options" \ |
70 | 73 | "${extra[@]}" $files |
| 74 | + if [[ $do_modified = false ]] && [[ $do_local == false ]]; then |
71 | 75 | ( |
72 | 76 | # Addig an extra format check for python files. |
73 | 77 | # The settings are in the ruff.toml in the home directory |
74 | 78 | # ruff format outputs a list of "would reformat file" followed by a recap |
75 | 79 | # "head" discards the recap and awk reformat the error message |
76 | 80 | cd "${basedir}" |
| 81 | + #this uses the same check in the base Makefile |
77 | 82 | if which ruff &> /dev/null; then |
78 | | - python -m ruff format --check \ |
| 83 | + ruff format --check \ |
79 | 84 | | grep 'Would reformat' \ |
80 | 85 | | awk '{ printf "[%s:0] (error) :ruff_format: python ruff formatting non satisfied\n", $3 }' \ |
81 | 86 | >&2 |
82 | | - python -m ruff check --output-format concise \ |
| 87 | + ruff check --output-format concise \ |
83 | 88 | | head -n -2 \ |
84 | 89 | | awk '{ printf "[%s] (error) :ruff_check: %s", substr($1,1,length($1)-1), $2; |
85 | 90 | $1=$2=""; |
|
93 | 98 | fi |
94 | 99 |
|
95 | 100 | ) |
| 101 | + fi |
96 | 102 | fi |
97 | 103 |
|
98 | 104 | if [ $do_cppcheck == true ]; then |
|
0 commit comments