Skip to content

Commit

Permalink
Lint Markdown files
Browse files Browse the repository at this point in the history
  • Loading branch information
replaceafill authored Dec 8, 2023
1 parent 67a5d2b commit cad65b3
Show file tree
Hide file tree
Showing 6 changed files with 80 additions and 60 deletions.
10 changes: 10 additions & 0 deletions .markdownlint.jsonc
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"default": true,
"MD010": {
"code_blocks": false
},
"MD013": {
"code_blocks": false,
"tables": false
}
}
4 changes: 4 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,7 @@ repos:
additional_dependencies:
- flake8-bugbear==23.9.16
- flake8-comprehensions==3.14.0
- repo: https://github.com/igorshubovych/markdownlint-cli
rev: v0.37.0
hooks:
- id: markdownlint
2 changes: 1 addition & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
include LICENSE
include README.rst
include README.md
64 changes: 64 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
# ammcpc --- Archivematica (AM) MediaConch (MC) Policy Checker (PC)

[![PyPI version](https://img.shields.io/pypi/v/ammcpc.svg)](https://pypi.python.org/pypi/ammcpc)
[![GitHub CI](https://github.com/artefactual-labs/ammcpc/actions/workflows/test.yml/badge.svg)](https://github.com/artefactual-labs/ammcpc/actions/workflows/test.yml)
[![codecov](https://codecov.io/gh/artefactual-labs/ammcpc/branch/master/graph/badge.svg?token=rNmMA59AqJ)](https://codecov.io/gh/artefactual-labs/ammcpc)

This command-line application and python module is a simple wrapper around the
MediaConch tool which takes a file and a MediaConch policy file as input and
prints to stdout a JSON object indicating, in a way that Archivematica likes,
whether the file passes the policy check.

## Installation

Install with pip:

```shell
pip install ammcpc
```

Install from source:

```shell
python setup.py install
```

## Usage

Command-line usage:

```shell
ammcpc <PATH_TO_FILE> <PATH_TO_POLICY>
```

Python usage with a policy file path:

```python
>>> from ammcpc import MediaConchPolicyCheckerCommand
>>> policy_checker = MediaConchPolicyCheckerCommand(
policy_file_path='/path/to/my-policy.xml')
>>> exitcode = policy_checker.check('/path/to/file.mkv')
```

Python usage with a policy as a string:

```python
>>> policy_checker = MediaConchPolicyCheckerCommand(
policy='<?xml><policy> ... </policy>',
policy_file_name='my-policy.xml')
>>> exitcode = policy_checker.check('/path/to/file.mkv')
```

## Requirements

System dependencies:

- MediaConch version 16.12

## Testing

To run the tests, make sure tox is installed, then:

```shell
tox
```
58 changes: 0 additions & 58 deletions README.rst

This file was deleted.

2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ dev = [

[tool.setuptools.dynamic]
version = {attr = "ammcpc.ammcpc.__version__"}
readme = {file = ["README.rst"]}
readme = {file = ["README.md"], content-type = "text/markdown"}

[tool.pytest.ini_options]
python_files = [
Expand Down

0 comments on commit cad65b3

Please sign in to comment.