Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lint Markdown files #7

Merged
merged 3 commits into from
Dec 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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