#140 Export a function to check whether rpmautospec is used
Closed by nphilipp. Opened by scoady.

Story Time

As a developer, I want an easy way to check whether or not a specfile is using some of rpmautospec's features so that I don't have to do it myself.

Acceptance Criteria

  • rpmautospec exports a new function rpmautospecEnabled or similar/better
  • this function checks for the existence of either %autorelease or %autochangelog
  • the signature should probably be something like:
    -- input: a specfile, which macro to check for (default should check both)
    -- output: a simple boolean
  • tests written
  • documentation added explaining the new function

Metadata Update from @nphilipp:
- Issue tagged with: F35 Change

I want to give consumers a way to say e.g. "I'm only interested in the use of %autorelease", and the function name should be PEP8 compliant, i.e. lowercase and separated by underscores. Here's how it could look like:

def specfile_uses_rpmautospec(specfile: str, check_autorelease: bool = True, check_autochangelog: bool = True) -> bool:
    ...

Metadata Update from @scoady:
- Issue assigned to scoady

Metadata Update from @amoloney:
- Issue set to the milestone: 0.2 (Stg Deployment)
- Issue tagged with: End User Testing

PR opened here: https://pagure.io/fedora-infra/rpmautospec/pull-request/155

Issue status updated to: Closed (was: Open)

Metadata