Skip to content

Commit d5b09c3

Browse files
Rename package attribute metafiles to file_patterns
Signed-off-by: Ayan Sinha Mahapatra <ayansmahapatra@gmail.com>
1 parent 98b5795 commit d5b09c3

26 files changed

Lines changed: 75 additions & 74 deletions

src/packagedcode/about.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030

3131
@attr.s()
3232
class AboutPackage(models.Package):
33-
metafiles = ('*.ABOUT',)
33+
file_patterns = ('*.ABOUT',)
3434
default_type = 'about'
3535

3636
@classmethod

src/packagedcode/bower.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131

3232
@attr.s()
3333
class BowerPackage(models.Package):
34-
metafiles = ('bower.json', '.bower.json')
34+
file_patterns = ('bower.json', '.bower.json')
3535
default_type = 'bower'
3636

3737
@classmethod

src/packagedcode/build.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939

4040
@attr.s()
4141
class BaseBuildManifestPackage(models.Package):
42-
metafiles = tuple()
42+
file_patterns = tuple()
4343

4444
@classmethod
4545
def recognize(cls, location):
@@ -68,12 +68,12 @@ def _is_build_manifest(cls, location):
6868
if not filetype.is_file(location):
6969
return False
7070
fn = fileutils.file_name(location)
71-
return any(fn == mf for mf in cls.metafiles)
71+
return any(fn == mf for mf in cls.file_patterns)
7272

7373

7474
@attr.s()
7575
class AutotoolsPackage(BaseBuildManifestPackage):
76-
metafiles = ('configure', 'configure.ac',)
76+
file_patterns = ('configure', 'configure.ac',)
7777
default_type = 'autotools'
7878

7979

@@ -175,19 +175,19 @@ def compute_normalized_license(self):
175175

176176
@attr.s()
177177
class BazelPackage(StarlarkManifestPackage):
178-
metafiles = ('BUILD',)
178+
file_patterns = ('BUILD',)
179179
default_type = 'bazel'
180180

181181

182182
@attr.s()
183183
class BuckPackage(StarlarkManifestPackage):
184-
metafiles = ('BUCK',)
184+
file_patterns = ('BUCK',)
185185
default_type = 'buck'
186186

187187

188188
@attr.s()
189189
class MetadataBzl(BaseBuildManifestPackage):
190-
metafiles = ('METADATA.bzl',)
190+
file_patterns = ('METADATA.bzl',)
191191
# TODO: Not sure what the default type should be, change this to something
192192
# more appropriate later
193193
default_type = 'METADATA.bzl'

src/packagedcode/cargo.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535

3636
@attr.s()
3737
class RustCargoCrate(models.Package):
38-
metafiles = ('Cargo.toml', 'Cargo.lock')
38+
file_patterns = ('Cargo.toml', 'Cargo.lock')
3939
default_type = 'cargo'
4040
default_primary_language = 'Rust'
4141
default_web_baseurl = 'https://crates.io'

src/packagedcode/chef.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939

4040
@attr.s()
4141
class ChefPackage(models.Package):
42-
metafiles = ('metadata.json', 'metadata.rb')
42+
file_patterns = ('metadata.json', 'metadata.rb')
4343
filetypes = ('.tgz',)
4444
mimetypes = ('application/x-tar',)
4545
default_type = 'chef'

src/packagedcode/conda.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ def logger_debug(*args):
4545

4646
@attr.s()
4747
class CondaPackage(models.Package):
48-
metafiles = ('meta.yaml', 'META.yml',)
48+
file_patterns = ('meta.yaml', 'META.yml',)
4949
default_type = 'conda'
5050
default_web_baseurl = None
5151
default_download_baseurl = 'https://repo.continuum.io/pkgs/free'

src/packagedcode/cran.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535

3636
@attr.s()
3737
class CranPackage(models.Package):
38-
metafiles = ('DESCRIPTION',)
38+
file_patterns = ('DESCRIPTION',)
3939
default_type = 'cran'
4040
default_web_baseurl = 'https://cran.r-project.org/package='
4141

src/packagedcode/debian.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333

3434
@attr.s()
3535
class DebianPackage(models.Package):
36-
metafiles = ('*.control',)
36+
file_patterns = ('*.control',)
3737
extensions = ('.deb',)
3838
filetypes = ('debian binary package',)
3939
mimetypes = ('application/x-archive', 'application/vnd.debian.binary-package',)

src/packagedcode/freebsd.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535

3636
@attr.s()
3737
class FreeBSDPackage(models.Package):
38-
metafiles = ('+COMPACT_MANIFEST',)
38+
file_patterns = ('+COMPACT_MANIFEST',)
3939
default_type = 'freebsd'
4040

4141
@classmethod

src/packagedcode/golang.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535

3636
@attr.s()
3737
class GolangPackage(models.Package):
38-
metafiles = ('go.mod', 'go.sum')
38+
file_patterns = ('go.mod', 'go.sum')
3939
default_type = 'golang'
4040
default_primary_language = 'Go'
4141
default_web_baseurl = 'https://pkg.go.dev'

0 commit comments

Comments
 (0)