Skip to content

Commit

Permalink
info_extraction: Add Info classes
Browse files Browse the repository at this point in the history
Adds Info classes relevant to extractors
of package.json and other meta-files.

Related to #100
  • Loading branch information
satwikkansal committed Jun 25, 2017
1 parent 1475727 commit 580eec8
Showing 1 changed file with 58 additions and 0 deletions.
58 changes: 58 additions & 0 deletions coala_quickstart/info_extraction/Information.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
from coala_quickstart.info_extraction.Info import Info


class LicenseUsedInfo(Info):
description = "License of the project."
value_type = (str,)
example_values = ["MIT", "GPL-3", "Apache-2.0"]


class VersionInfo(Info):
description = "Version information, see http://semver.org/"
value_type = (str,)
example_values = [">=1.2.7", "~1.2.3", "^0.2"]


class ProjectDependencyInfo(Info):
description = "Dependency of the project."
value_type = (str,)
example_values = ['some_npm_package_name', 'some_gem_name', 'other_dep']

def __init__(self,
source,
value,
extractor=None,
version=None,
url=''):
super().__init__(source, value, extractor, version=version, url=url)


class PathsInfo(Info):
description = "File path globs mentioned in the file."
value_type = ([str],)
example_values = ["**.py", "dev/tests/**"]


class IncludePathsInfo(PathsInfo):
description = "Target files to perform analysis."


class IgnorePathsInfo(PathsInfo):
description = "Files to ignore during analysis."


class ManFilesInfo(Info):
description = "Filenames to put in place for the man program to find."
value_type = (str, [str])
example_values = ["./man/doc.1", ["./man/foo.1", "./man/bar.1"]]

def __init__(self,
source,
value,
extractor=None,
keyword=""):
"""
:param keyword: Primary keyword for ``man`` command that would display
the man pages provided in value argument.
"""
super().__init__(source, value, extractor, keyword=keyword)

0 comments on commit 580eec8

Please sign in to comment.