Skip to content

Commit

Permalink
Run ctags and xgettext only on source code files
Browse files Browse the repository at this point in the history
Signed-off-by: Keshav Priyadarshi <[email protected]>
  • Loading branch information
keshav-space committed Mar 18, 2024
1 parent 812faf9 commit e621255
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ install_requires =
scancode-toolkit
plugincode
commoncode
typecode

[options.packages.find]
where = src
Expand Down
4 changes: 4 additions & 0 deletions src/source_inspector/strings_xgettext.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
from commoncode.cliutils import PluggableCommandLineOption
from plugincode.scan import ScanPlugin
from plugincode.scan import scan_impl
from typecode.contenttype import Type

"""
Extract strinsg from source code files with xgettext.
Expand Down Expand Up @@ -67,6 +68,9 @@ def collect_strings(location, clean=True):
if not is_xgettext_installed():
return

if not Type(location).is_source:
return

rc, result, err = command.execute(
cmd_loc="xgettext",
args=[
Expand Down
4 changes: 4 additions & 0 deletions src/source_inspector/symbols_ctags.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
from commoncode.cliutils import PluggableCommandLineOption
from plugincode.scan import ScanPlugin
from plugincode.scan import scan_impl
from typecode.contenttype import Type

"""
Extract symbols information from source code files with ctags.
Expand Down Expand Up @@ -67,6 +68,9 @@ def collect_symbols(location):
if not is_ctags_installed():
return

if not Type(location).is_source:
return

rc, result, err = command.execute(
cmd_loc="ctags",
args=["--output-format=json", "-f", "-", location],
Expand Down

0 comments on commit e621255

Please sign in to comment.