Add sys/lint.sh and run it in the CI ##refactor

This commit is contained in:
pancake 2022-06-27 11:31:24 +02:00
parent 795a274b48
commit e69645a9c2
4 changed files with 15 additions and 2 deletions

View File

@ -44,6 +44,8 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Linting
run: sys/lint.sh
- name: Building without capstone
run: |
cp -f dist/plugins-cfg/plugins.nocs.cfg plugins.cfg

View File

@ -5533,7 +5533,8 @@ R_API int r_core_print_disasm(RCore *core, ut64 addr, ut8 *buf, int len, int cou
if (p) {
core->asmqjmps_size = R_CORE_ASMQJMPS_NUM;
core->asmqjmps = p;
for (int i = 0; i < R_CORE_ASMQJMPS_NUM; i++) {
int i;
for (i = 0; i < R_CORE_ASMQJMPS_NUM; i++) {
core->asmqjmps[i] = UT64_MAX;
}
}

View File

@ -135,7 +135,8 @@ R_API int r_main_ravc2(int argc, const char **argv) {
if (message) {
RList *files = r_list_new();
if (files) {
for (size_t i = 2; i < argc - 1; i++) {
size_t i;
for (i = 2; i < argc - 1; i++) {
char *file = r_str_new(argv[opt.ind + i]);
if (!file || !r_list_append (files, file)) {
free (message);

9
sys/lint.sh Executable file
View File

@ -0,0 +1,9 @@
#!/bin/sh
(git grep 'for (int' | grep -v sys/) && exit 1
(git grep 'for (long' | grep -v sys/) && exit 1
(git grep 'for (size_t' | grep -v sys/) && exit 1
(git grep 'R_LOG_' | grep '\\n' | grep -v sys/) ## && exit 1
exit 0