semvec/pypi-packages huggingface dataset:
pystolint 0.6.1
Linters composer
Requires Python: >=3.9

# 🔫 pystolint 🔫

## Yet another python linter?

No. It's just a runner for [ruff](https://docs.astral.sh/ruff/) + [mypy](https://mypy.readthedocs.io/en/stable/) with [these](https://github.com/hhru/pystolint/blob/master/pystolint/default_config/pyproject.toml) settings


## Why?

I'm fed up with:
1. Having to copy settings for every single project. (at least until "parent pyproject.toml" is not invented)
2. Not being able to apply checks only to git diffs, which makes it hard to add linters to large projects
3. Not being able to deprecate certain things and preventing them in new code. 
    - [Solved for 3.13+](https://mypy.readthedocs.io/en/stable/changelog.html#support-for-deprecated-decorator-pep-702)


## Install

### Simple:
- `pip install pystolint`

or

- `pip install git+ssh://git@github.com/hhru/pystolint.git@master`

### Dev:

1. Clone repo
```
git clone git@github.com:hhru/pystolint.git ~/projects/pystolint
cd ~/projects/pystolint
python -m venv .venv
source .venv/bin/activate
pip install -e .
```

2. Create global shortcut (/usr/local/bin/pys):
```
  #!/path/to/your/pystolint/.venv/bin/python
  import sys
  from pystolint.main import main

  if __name__ == '__main__':
    sys.exit(main())
```
3. Make executable:
```
chmod +x /usr/local/bin/pys
```


## Usage

### Check code:
```bash
pys check .
pys check path1 path2
pys check --diff
```

### Format code:

```bash
pys format .
pys format path1 path2
```

### Tools

You can use specific tool for checking/formatting:
```bash
pys check --tool mypy .
```
This will run mypy only. **Be aware that mypy requires pydantic as a project dependency by default.**
You can disable this requirement by editing tool.mypy.plugins in pyproject.toml or add extra 'pydantic' to pystolint 
dependency.


## Settings

Can be specified from cli or pyproject.toml. Cli settings have bigger priority

example toml:
```toml
[tool.pystolint]
base_toml_path = "/path/to/shared/config.toml"
base_branch_name = "develop"
```

cli:
- `--base_toml_path` - path or link for replace pystolint [default settings](https://github.com/hhru/pystolint/blob/master/pystolint/default_config/pyproject.toml)
- `--base_branch_name` - branch name from which to get diff (default is master)
- `--config` - specify path to local toml configs (default is `pyproject.toml` in current dir)
mdformat-gherkin 0.1.0
Mdformat plugin to format Gherkin code blocks using reformat-gherkin
Requires Python: >=3.7
Keywords: mdformat, markdown, gherkin, formatter

<div align="center">

[![License](https://img.shields.io/badge/license-BSD--3--Clause-green)](LICENSE)

</div>

<!-- mdformat-toc start --slug=github --maxlevel=6 --minlevel=1 -->

- [Features](#features)
- [Installation](#installation)
- [Usage](#usage)
- [Example](#example)
- [Pre-commit Hook](#pre-commit-hook)
- [License](#license)
- [Acknowledgments](#acknowledgments)

<!-- mdformat-toc end -->

______________________________________________________________________

## Features<a name="features"></a>

- Formats Gherkin feature files within markdown code blocks
- Preserves all markdown formatting outside Gherkin code blocks
- Supports all standard Gherkin keywords and syntax
- Consistent formatting for better version control diffs
- Seamless integration with pre-commit hooks

## Installation<a name="installation"></a>

```bash
pip install mdformat-gherkin
```

You may pin the reformat-gherkin dependency for formatting stability:

```bash
pip install mdformat-gherkin reformat-gherkin==v3.0.1
```

## Usage<a name="usage"></a>

When using mdformat on the command line, Gherkin formatting will be automatically enabled after install.

When using mdformat Python API, code formatting for Gherkin will have to be enabled explicitly:

````python
import mdformat

unformatted = """```gherkin
Feature: Test feature
  Scenario: Test scenario
    Given I have a test
    When I run the test
    Then it should pass
```"""

formatted = mdformat.text(unformatted, codeformatters={"gherkin"})
print(formatted)
````

## Example<a name="example"></a>

Before formatting:

````markdown
```gherkin
Feature: Test feature
Scenario: Test scenario
Given I have a test
When I run the test
Then it should pass
```
````

After formatting with `mdformat-gherkin`:

````markdown
```gherkin
Feature: Test feature

  Scenario: Test scenario
    Given I have a test
    When I run the test
    Then it should pass
```
````

## Pre-commit Hook<a name="pre-commit-hook"></a>

You can use this plugin with [pre-commit](https://pre-commit.com/). Add the following to your `.pre-commit-config.yaml`:

```yaml
  - repo: https://github.com/executablebooks/mdformat
    rev: 1.0.0  # Use the latest version
    hooks:
      - id: mdformat
        additional_dependencies:
          - mdformat-gherkin
        # Optional: pin specific versions
        # - reformat-gherkin==v3.0.1
```

## License<a name="license"></a>

This project is licensed under the BSD 3-Clause License - see the [LICENSE](LICENSE) file for details.

## Acknowledgments<a name="acknowledgments"></a>

This project is based on the work of [reformat-gherkin](https://github.com/ducminh-phan/reformat-gherkin).