```
$ git log | head
commit ae7e926e126a46a09eb3824886ce89a882a270ef
$ make clean && make install
rm -f  autorun.la
rm -rf .libs _libs
rm -f *.o
rm -f *.lo
rm -f ./so_locations
  CC       autorun_la-autorun.lo
  CC       autorun_la-plugin_main.lo
  CC       autorun_la-spawn.lo
  CC       autorun_la-utils.lo
  CCLD     autorun.la
```

```
$ cppcheck *.c --enable=all --check-level=exhaustive 2>&1 | grep -vP 
'(<glib/gstdio.h>|<geanyplugin.h>|<gtk/gtk.h>|<spawn.h>)'
Checking autorun.c ...
1/4 files checked 23% done
Checking plugin_main.c ...
plugin_main.c:117:42: style: Parameter 'plugin' can be declared as pointer to 
const. However it seems that 'autorun_cleanup' is a callback function, if 
'plugin' is declared with const you might also need to cast function 
pointer(s). [constParameterCallback]
static void autorun_cleanup(GeanyPlugin* plugin, gpointer pdata) {
                                         ^
plugin_main.c:136:27: note: You might need to cast the function pointer here
 plugin->funcs->cleanup = autorun_cleanup;
                          ^
plugin_main.c:117:42: note: Parameter 'plugin' can be declared as pointer to 
const
static void autorun_cleanup(GeanyPlugin* plugin, gpointer pdata) {
                                         ^
2/4 files checked 43% done
Checking spawn.c ...
spawn.c:136:46: style: Condition 'success' is always true 
[knownConditionTrueFalse]
    if (g_strcmp0(interceptor, "BS") == 0 && success && !tmpfile) {
                                             ^
spawn.c:49:17: style: Variable 'cmd' can be declared as pointer to const 
[constVariablePointer]
   AUTORUN_CMD* cmd = ((AUTORUN_CMD*)elem->data);
                ^
spawn.c:179:15: style: Variable 'lineptr' can be declared as pointer to const 
[constVariablePointer]
       gchar* lineptr = g_strstr_len(stdout_data->str, 255, ":");
              ^
spawn.c:203:15: style: Variable 'lineptr' can be declared as pointer to const 
[constVariablePointer]
       gchar* lineptr = g_strstr_len(stdout_data->str, 255, ":");
              ^
spawn.c:221:15: style: Variable 'lineptr' can be declared as pointer to const 
[constVariablePointer]
       gchar* lineptr = g_strstr_len(stdout_data->str, 255, ":");
              ^
spawn.c:238:15: style: Variable 'lineptr' can be declared as pointer to const 
[constVariablePointer]
       gchar* lineptr = g_strstr_len(stdout_data->str, 255, ":");
              ^
3/4 files checked 86% done
Checking utils.c ...
4/4 files checked 100% done
plugin_main.c:124:0: style: The function 'geany_load_module' is never used. 
[unusedFunction]
void geany_load_module(GeanyPlugin* plugin) {
autorun.c:26:0: style: The function 'autorun_cmd_new' should have static 
linkage since it is not used outside of its translation unit. [staticFunction]
AUTORUN_CMD* autorun_cmd_new() {
^
autorun.c:38:0: style: The function 'autorun_cmd_free' should have static 
linkage since it is not used outside of its translation unit. [staticFunction]
void autorun_cmd_free(AUTORUN_CMD* cmd) {
^
nofile:0:0: information: Active checkers: 109/856 (use 
--checkers-report=<filename> to see details) [checkersReport]
```

I know this project doesnt use clang-tidy, but I happen to use it, so I set it 
up too.
```
$ clang-tidy-19 -p autorun/build *.c 
[1/4] Processing file autorun/src/autorun.c.
[2/4] Processing file autorun/src/plugin_main.c.
1 error generated.
Error while processing autorun/src/plugin_main.c.
[3/4] Processing file autorun/src/spawn.c.
1 error generated.
Error while processing autorun/src/spawn.c.
[4/4] Processing file autorun/src/utils.c.
1 error generated.
Error while processing autorun/src/utils.c.
autorun/src/plugin_main.c:132:19: error: use of undeclared identifier 
'LOCALEDIR' [clang-diagnostic-error]
  132 |         main_locale_init(LOCALEDIR, GETTEXT_PACKAGE);
      |                          ^
Found compiler error(s).
```
That looks like clang-tidy doesn't get the po/ loader magic, but nothing else 
reported.

built against geany/geany@98bcbee3b99d71dfcdd9d3556ace9530ceda818d
geany --verbose has no messages

May close geany/geany-plugins#1577

You can view, comment on, or merge this pull request online at:

  https://github.com/geany/geany-plugins/pull/1582

-- Commit Summary --

  * Auto-run Templating new plugin
  * add filedef iterator impl
  * Seperate out the keyfile parsers to cleanup plugin_main
  * update README with known bug and keyfile change
  * add keyfile parser
  * add parser container
  * disable project-save handler due to geany/geany#4603
  * FIX cmd allocator
  * spawn controller should honor order
  * Update README to remove %e
  * Enable before-save interceptor
  * Updated project to use clang for .h as well
  * cleanup logging

-- File Changes --

    M MAINTAINERS (7)
    M Makefile.am (4)
    A autorun/AUTHORS (1)
    A autorun/CMakeLists.txt (22)
    A autorun/COPYING (340)
    A autorun/ChangeLog (0)
    A autorun/Makefile.am (4)
    A autorun/NEWS (2)
    A autorun/README (152)
    A autorun/THANKS (12)
    A autorun/src/.clang-format (214)
    A autorun/src/Makefile.am (19)
    A autorun/src/autorun.c (178)
    A autorun/src/autorun.h (50)
    A autorun/src/plugin_main.c (141)
    A autorun/src/spawn.c (284)
    A autorun/src/spawn.h (28)
    A autorun/src/utils.c (113)
    A autorun/src/utils.h (27)
    A build/autorun.m4 (9)
    M configure.ac (1)
    M po/POTFILES.in (3)

-- Patch Links --

https://github.com/geany/geany-plugins/pull/1582.patch
https://github.com/geany/geany-plugins/pull/1582.diff

-- 
Reply to this email directly or view it on GitHub:
https://github.com/geany/geany-plugins/pull/1582
You are receiving this because you are subscribed to this thread.

Message ID: <geany/geany-plugins/pull/[email protected]>

Reply via email to