Skip to content
Closed
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
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ This repo stores the following shared repository settings/configurations/templat
- `isort`
- `pylint`
- `codecov`
- `mypy`
- Shared configurations for Azure Pipelines
- Shared configurations for GitHub Actions
- Issue/PR labels shared across the organization
Expand Down
3 changes: 2 additions & 1 deletion azure/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,12 @@ The templates are organized into the following files:
| `COVERAGE` | boolean | `false` | Flag to report test coverage to `codecov` |
| `TIMEOUT_STYLE` | number | `10` | Runtime allowed for each style check, in minutes |
| `IGNORE_STYLE` | boolean | `false` | Flag to allow `formatting and linting` checks to fail without failing the pipeline |
| `BASE_FORMAT_AND_LINT` | boolean | `false` | Flag to trigger the `base_format_and_lint` check |
| `BASE_FORMAT_AND_LINT` | boolean | `true` | Flag to trigger the `base_format_and_lint` check |
| `ISORT` | boolean | `false` | Flag to trigger the `isort` check |
| `PYLINT` | boolean | `false` | Flag to trigger the `pylint` check |
| `CLANG_FORMAT` | boolean | `false` | Flag to trigger the `clang-format` check |
| `FPRETTIFY` | boolean | `false` | Flag to trigger the `fprettify` check |
| `MYPY` | boolean | `false` | Flag to trigger the `mypy` check |
| `TAPENADE` | boolean | `false` | Flag to trigger the Tapenade check |
| `TIMEOUT_TAPENADE` | number | `10` | Runtime allowed for the Tapenade check, in minutes |
| `TAPENADE_SCRIPT` | string | `.github/build_tapenade.sh` | Path to Bash script with commands to run Tapenade |
Expand Down
24 changes: 24 additions & 0 deletions azure/azure_style.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ parameters:
- name: FPRETTIFY
type: boolean
default: false
- name: MYPY
type: boolean
default: false
jobs:
- job: base_format_and_lint
pool:
Expand Down Expand Up @@ -153,4 +156,25 @@ jobs:
# Exit with an error if any of the tracked files changed
git diff --summary --exit-code

- job: mypy
pool:
vmImage: "ubuntu-22.04"
timeoutInMinutes: ${{ parameters.TIMEOUT }}
continueOnError: ${{ parameters.IGNORE_STYLE }}
condition: ${{ parameters.MYPY }}
steps:
- checkout: self
- checkout: azure_template
- task: UsePythonVersion@0
inputs:
versionSpec: "3.11"
- script: |
cd ${{ parameters.REPO_NAME }}

pip install wheel
pip install mypy

# Run mypy check (should pick up local config from mypy.ini or .mypy.ini if present)
mypy


7 changes: 6 additions & 1 deletion azure/azure_template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@ parameters:
- name: IGNORE_STYLE
type: boolean
default: false
- name: BASE_FORMAT_AND_LINT
type: boolean
default: true
- name: ISORT
type: boolean
default: false
Expand All @@ -54,7 +57,7 @@ parameters:
- name: FPRETTIFY
type: boolean
default: false
- name: RUFF
- name: MYPY
type: boolean
default: false
# Tapenade
Expand Down Expand Up @@ -115,10 +118,12 @@ stages:
REPO_NAME: ${{ parameters.REPO_NAME }}
TIMEOUT: ${{ parameters.TIMEOUT_STYLE }}
IGNORE_STYLE: ${{ parameters.IGNORE_STYLE }}
BASE_FORMAT_AND_LINT: ${{ parameters.BASE_FORMAT_AND_LINT }}
ISORT: ${{ parameters.ISORT }}
PYLINT: ${{ parameters.PYLINT }}
CLANG_FORMAT: ${{ parameters.CLANG_FORMAT }}
FPRETTIFY: ${{ parameters.FPRETTIFY }}
MYPY: ${{ parameters.MYPY }}

- stage: Tapenade
dependsOn: []
Expand Down
Loading