priv-kweihmann / oelint-adv

Advanced oelint
BSD 2-Clause "Simplified" License
54 stars 27 forks source link

[feature] Python port #524

Closed Freed-Wu closed 5 months ago

Freed-Wu commented 6 months ago

Can it provide a python port? Such as:

test.py:

#!/usr/bin/env python
from oelint_adv import check, format_result
with open("XXX.bb") as f:
    text = f.read()
result = check(text)
print(format_result(result))
$ ./test.py
/disk/meta-some/cppcheck-native/cppcheck.inc:26:error:oelint.task.nomkdir:'mkdir' shall not be used in do_install. Use 'install'
priv-kweihmann commented 6 months ago

Did I get that right, you want to use oelint-adv as part of a library? If so, yes that could be done, if not please describe a bit more in detail what exactly you want to achieve

Freed-Wu commented 6 months ago

Yes, I want :smile:

Freed-Wu commented 5 months ago

Current python port is:

for issue in run(create_lib_arguments([path])):

Can we have an optional document content?

When we

for issue in run(create_lib_arguments([path], [content])):

It will ignore the file content of path, and use content to replace?

It can be helpful for:

priv-kweihmann commented 5 months ago

Sure, I take that into the backlog