Skip to content

Commit

Permalink
.ci/generate_bear_metadata.py: Strip exe paths
Browse files Browse the repository at this point in the history
Avoid including paths from executable dependencies,
and sync with package_manager adding new distribution class 'pkg'.
  • Loading branch information
jayvdb committed Aug 5, 2019
1 parent f672689 commit 0619892
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 5 deletions.
6 changes: 5 additions & 1 deletion .ci/generate_bear_metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,10 @@ def helper(requirements, instance_dict):
instance_dict[type(requirement).__name__].add(requirement)


def _clean_executable(executable):
return executable.rpartition('/')[2].lower().replace('.exe', '')


def get_all_requirements(bears):
bear_requirements = {}

Expand All @@ -189,7 +193,7 @@ def get_all_requirements(bears):
if hasattr(bear, 'get_executable'):
executable = bear.get_executable()
if executable:
requirement = ExecutableRequirement(executable)
requirement = ExecutableRequirement(_clean_executable(executable))
instance_dict['ExecutableRequirement'].add(requirement)
helper(bear.REQUIREMENTS, instance_dict)
bear_requirements[str(bear.name)] = instance_dict
Expand Down
28 changes: 24 additions & 4 deletions bear-metadata.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,7 @@ bear_metadata:
brew: cppcheck
dnf: cppcheck
pacman: cppcheck
pkg: cppcheck
portage: cppcheck
xbps: cppcheck
yum: cppcheck
Expand All @@ -206,6 +207,7 @@ bear_metadata:
- dnf
- exe
- pacman
- pkg
- portage
- xbps
- yum
Expand Down Expand Up @@ -326,6 +328,7 @@ bear_metadata:
brew: flawfinder
dnf: flawfinder
pacman: flawfinder
pkg: flawfinder
portage: flawfinder
xbps: flawfinder
yum: flawfinder
Expand All @@ -344,6 +347,7 @@ bear_metadata:
- exe
- flawfinder
- pacman
- pkg
- portage
- xbps
- yum
Expand All @@ -360,6 +364,7 @@ bear_metadata:
brew: mono
dnf: mono
pacman: mono
pkg: mono
portage: dev-lang/mono
xbps: mono
yum: mono
Expand All @@ -378,6 +383,7 @@ bear_metadata:
- mcs
- mono
- pacman
- pkg
- portage
- xbps
- yum
Expand Down Expand Up @@ -725,6 +731,7 @@ bear_metadata:
brew: indent
dnf: indent
pacman: indent
pkg: indent
portage: indent
xbps: indent
yum: indent
Expand All @@ -743,6 +750,7 @@ bear_metadata:
- exe
- indent
- pacman
- pkg
- portage
- xbps
- yum
Expand All @@ -762,6 +770,7 @@ bear_metadata:
brew: ghc-mod
dnf: ghc-mod
pacman: ghc-mod
pkg: ghc-mod
portage: ghc-mod
xbps: ghc-mod
yum: ghc-mod
Expand All @@ -780,6 +789,7 @@ bear_metadata:
- ghc-mod
- haskell
- pacman
- pkg
- portage
- xbps
- yum
Expand Down Expand Up @@ -1000,7 +1010,7 @@ bear_metadata:
filename: HTMLLintBear.py
requirements:
exe:
/home/areebbeigh/virtualenvs/coala-venv/bin/python3:
python3:
pip:
html-linter:
version: ~=0.4.0
Expand All @@ -1009,7 +1019,7 @@ bear_metadata:
- Jinja2
- PHP
tags:
- /home/areebbeigh/virtualenvs/coala-venv/bin/python3
- python3
- exe
- hypertext
- pip
Expand Down Expand Up @@ -1263,6 +1273,7 @@ bear_metadata:
brew: chktex
dnf: chktex
pacman: chktex
pkg: chktex
portage: chktex
xbps: chktex
yum: chktex
Expand All @@ -1280,6 +1291,7 @@ bear_metadata:
- exe
- latex
- pacman
- pkg
- portage
- xbps
- yum
Expand Down Expand Up @@ -1411,7 +1423,7 @@ bear_metadata:
filename: MypyBear.py
requirements:
exe:
/home/areebbeigh/virtualenvs/coala-venv/bin/python3:
python3:
pip:
mypy:
version: ==0.590
Expand All @@ -1420,7 +1432,7 @@ bear_metadata:
- Python 2
- Python 3
tags:
- /home/areebbeigh/virtualenvs/coala-venv/bin/python3
- python3
- exe
- pip
- python
Expand Down Expand Up @@ -1990,6 +2002,7 @@ bear_metadata:
brew: ruby
dnf: ruby
pacman: ruby
pkg: ruby
portage: ruby
xbps: ruby
yum: ruby
Expand All @@ -2006,6 +2019,7 @@ bear_metadata:
- dnf
- exe
- pacman
- pkg
- portage
- ruby
- xbps
Expand Down Expand Up @@ -2114,6 +2128,7 @@ bear_metadata:
brew: shellcheck
dnf: shellcheck
pacman: shellcheck
pkg: shellcheck
portage: shellcheck
xbps: shellcheck
yum: shellcheck
Expand All @@ -2133,6 +2148,7 @@ bear_metadata:
- dnf
- exe
- pacman
- pkg
- portage
- shell
- shellcheck
Expand Down Expand Up @@ -2369,6 +2385,7 @@ bear_metadata:
brew: perl
dnf: perl
pacman: perl
pkg: perl
portage: perl
xbps: perl
yum: perl
Expand All @@ -2386,6 +2403,7 @@ bear_metadata:
- exe
- pacman
- perl
- pkg
- portage
- vhdl
- xbps
Expand Down Expand Up @@ -2480,6 +2498,7 @@ bear_metadata:
brew: libxml2
dnf: libxml2
pacman: libxml2
pkg: libxml2
portage: dev-libs/libxml2
xbps: libxml2
yum: libxml2
Expand All @@ -2496,6 +2515,7 @@ bear_metadata:
- exe
- libxml2
- pacman
- pkg
- portage
- xbps
- xml2
Expand Down
10 changes: 10 additions & 0 deletions bear-requirements.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,7 @@ distro_requirements:
xbps: chktex
yum: chktex
zypper: texlive-chktex
pkg: chktex
cppcheck:
packages:
apt_get: cppcheck
Expand All @@ -258,6 +259,7 @@ distro_requirements:
xbps: cppcheck
yum: cppcheck
zypper: cppcheck
pkg: cppcheck
dart:
packages:
brew: dart
Expand All @@ -280,6 +282,7 @@ distro_requirements:
xbps: flawfinder
yum: flawfinder
zypper: flawfinder
pkg: flawfinder
ghc-mod:
packages:
apt_get: ghc-mod
Expand All @@ -290,6 +293,7 @@ distro_requirements:
xbps: ghc-mod
yum: ghc-mod
zypper: ghc-mod
pkg: ghc-mod
hlint:
packages:
apt_get: hlint
Expand All @@ -303,6 +307,7 @@ distro_requirements:
xbps: indent
yum: indent
zypper: indent
pkg: indent
libperl-critic-perl:
packages:
apt_get: libperl-critic-perl
Expand All @@ -322,6 +327,7 @@ distro_requirements:
xbps: libxml2
yum: libxml2
zypper: libxml2
pkg: libxml2
mono:
packages:
apt_get: mono-mcs
Expand All @@ -332,6 +338,7 @@ distro_requirements:
xbps: mono
yum: mono
zypper: mono
pkg: mono
perl:
packages:
apt_get: perl
Expand All @@ -342,6 +349,7 @@ distro_requirements:
xbps: perl
yum: perl
zypper: perl
pkg: perl
php-cli:
packages:
apt_get: php-cli
Expand Down Expand Up @@ -371,6 +379,7 @@ distro_requirements:
xbps: ruby
yum: ruby
zypper: ruby
pkg: ruby
shellcheck:
packages:
apt_get: shellcheck
Expand All @@ -381,6 +390,7 @@ distro_requirements:
xbps: shellcheck
yum: shellcheck
zypper: shellcheck
pkg: shellcheck
verilator:
packages:
apt_get: verilator
Expand Down

0 comments on commit 0619892

Please sign in to comment.