Skip to content

Commit

Permalink
MP3CheckBear: Add MP3CheckBear
Browse files Browse the repository at this point in the history
MP3CheckBear checks mp3 files for consistency and print
several errors and warnings.

Closes: #1519
  • Loading branch information
shreyans800755 committed Jun 15, 2017
1 parent 45dfb62 commit a88c815
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 0 deletions.
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ addons:
- opam
- php-codesniffer
- verilator
- mp3check

cache:
pip: true
Expand Down
34 changes: 34 additions & 0 deletions bears/mp3/MP3CheckBear.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
from coalib.bearlib.abstractions.Linter import linter
from coalib.bears.LocalBear import LocalBear
from coalib.results.Result import Result
from coalib.results.RESULT_SEVERITY import RESULT_SEVERITY
from dependency_management.requirements.DistributionRequirement import (
DistributionRequirement)


@linter(executable='mp3check')
class MP3CheckBear(LocalBear):
"""
Report possible security weaknesses for MP3 files.
For more information,
consult <https://code.google.com/archive/p/mp3check/>.
"""
LANGUAGES = {'MP3'}
REQUIREMENTS = {DistributionRequirement(apt_get='mp3check')}
AUTHORS = {'The coala developers'}
AUTHORS_EMAILS = {'[email protected]'}
LICENSE = 'AGPL-3.0'
USE_RAW_FILES = True

@staticmethod
def create_arguments(filename, file, config_file):
return '-ase', filename

def process_output(self, output, filename, file):
lines = output.split('\n')
lines = (i for i in lines)
for msg in lines:
yield Result.from_values(origin=self,
message=msg,
file=filename,
severity=RESULT_SEVERITY.MAJOR)
Empty file added bears/mp3/__init__.py
Empty file.

0 comments on commit a88c815

Please sign in to comment.