Metadata-Version: 2.1
Name: anaconda-linter
Version: 0.0.4
Summary: A linter to validate recipe meta.yaml files.
Home-page: https://github.com/anaconda-distribution/anaconda-linter
Author: Anaconda, Inc.
Author-email: distribution_team@anaconda.com
License: BSD-3-Clause
Keywords: anaconda_linter
Classifier: Development Status :: 2 - Pre-Alpha
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: BSD License
Classifier: Natural Language :: English
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: Implementation :: CPython
Classifier: Topic :: Software Development :: Quality Assurance
Classifier: Topic :: Software Development :: Libraries
Classifier: Topic :: Utilities
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE
License-File: AUTHORS.rst
Requires-Dist: conda-build
Requires-Dist: jinja2
Requires-Dist: jsonschema
Requires-Dist: license-expression
Requires-Dist: networkx
Requires-Dist: requests
Requires-Dist: ruamel.yaml
Provides-Extra: docs
Requires-Dist: sphinx ; extra == 'docs'
Requires-Dist: myst-parser ; extra == 'docs'

# Anaconda Linter

Anaconda Linter is a utility to validate that a recipe for a conda package
will render correctly.

The package is currently a very rough draft of a pure Python linter specifically to make sure
that packages' meta.yaml files adhere to certain Anaconda standards.

## Installation
1. `make environment`
2. `conda activate anaconda-linter`

## Usage

The usage is similar to conda-build.

1. navigate into the folder of your main `conda_build_config.yaml` file:
`cd <path/to/aggregate/>`

2. run `conda-lint` with:  `conda-lint <path_to_feedstock>`

Concrete example:
`cd ~/work/recipes/aggregate/`
`conda-lint -v ../wip/airflow-feedstock`

## Skipping Lints

In order to force the linter to ignore a certain type of lint, you can use the top-level `extra` key in a `meta.yaml file`. To skip lints individually, add lints from this [list of current lints](anaconda_linter/lint_names.md) to the `extra` key as a list with a `skip-lints` key. For example:

    extra:
      skip-lints:
        - unknown_selector
        - invalid_url

You can also do the opposite of this, and skip all other lints *except* the lints you want, with `only-lint`. For example:

    extra:
      only-lint:
        - missing_license
        - incorrect_license

Note: if you have both `skip-lints` and `only-lint`, any lints in `skip-lint` will override identical lints in `only-lint`.

## Testing the Anaconda Linter

Make sure that your `anaconda-linter` environment is activated, then:

`pytest tests` OR `make test` (if you would like to see test reports)

It's that easy!

## Contributing

We welcome contributions for bug fixes, enhancements, or new tests.
For a list of projects, please see the [Issues page](https://github.com/anaconda-distribution/anaconda-linter/issues)

Before submitting a PR, please make sure to:

  * run `make pre-commit` to format your code using `flake8` and `black`.
  * run `make test` to make sure our unit tests pass.
  * add unit tests for new functionality. To print a coverage report, run `make coverage`.

## Contributions
This new package is inspired by bioconda's [linter](https://github.com/bioconda/bioconda-utils/blob/master/bioconda_utils/lint/__init__.py).

Some of the code for suggesting hints comes from [Peter Norvig](http://norvig.com/spell-correct.html).

## License
[BSD-3-Clause](https://choosealicense.com/licenses/bsd-3-clause/)


# Changelog
Note: version releases in the 0.x.y range may introduce breaking changes.

## 0.0.4

- Add test suite
- Update documentation
- Bug fixes for message system
- Add new check: `patch_unnecessary`
- Add `--severity` option to control the severity level of linter messages
- Remove threading functionality and unused functions
- Use ruamel.yaml through the module and remove pyyaml
- Remove `load_skips` function
- Bug fix: Correct mocks of conda-build jinja functions. PR: #131, Issues: #118
- Bug fix: Correct error line reporting. PR: #131, Issues: #123
- Bug fix: Handle YAML parsing errors. PR: #131, Issues: #126
- Enhancement: Render recipe using cbc files defined variables. PR: #131
- Add multi-output recipe support. PR: #149, #159, Issues: #88
- Fix missing_pip_check for test scripts. PR: #149, Issues: #144
- Implement new Perseverance Recipe Standards. PR: #160, #161, #162, #164, #165
- Code clean-ups. PR: #154, #155, #163.

## 0.0.3

- Update installation files
- Bug fixes

## 0.0.2

- patch: Additional checks added
- patch: More compilers supported

## 0.0.1

Initial release:
- To support downloading of tarballs like: https://github.com/anaconda-distribution/anaconda-linter/archive/{{ version }}.tar.gz
