Skip to content

Commit 28fba19

Browse files
authored
Merge pull request #6 from MiraGeoscience/DEVOPS-637
DEVOPS-637: add option to check-copyright to scan some files entirely
2 parents afc5024 + 7848e6c commit 28fba19

21 files changed

Lines changed: 1547 additions & 185 deletions
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: Python analysis
2+
3+
on:
4+
pull_request:
5+
types: [opened, synchronize, reopened, ready_for_review]
6+
branches:
7+
- develop
8+
- main
9+
- release/**
10+
- feature/**
11+
- hotfix/**
12+
push:
13+
branches:
14+
- develop
15+
- main
16+
- release/**
17+
- feature/**
18+
- hotfix/**
19+
20+
concurrency:
21+
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
22+
cancel-in-progress: true
23+
24+
jobs:
25+
call-workflow-static-analysis:
26+
name: Static analysis
27+
uses: MiraGeoscience/CI-tools/.github/workflows/reusable-python-static_analysis.yml@main
28+
with:
29+
package-manager: 'poetry'
30+
app-name: 'mirageoscience'
31+
python-version: '3.10'
32+
call-workflow-pytest:
33+
name: Pytest
34+
uses: MiraGeoscience/CI-tools/.github/workflows/reusable-python-pytest.yml@main
35+
with:
36+
package-manager: 'poetry'
37+
python-versions: '["3.10", "3.11", "3.12"]'
38+
os: '["ubuntu-latest", "windows-latest"]'
39+
cache-number: 1
40+
codecov-reference-python-version: '3.10'
41+
codecov-reference-os: '["windows-latest"]'
42+
secrets:
43+
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,11 @@ venv.bak/
140140
# mkdocs documentation
141141
/site
142142

143+
#pycharm
144+
/.idea/*
145+
!/.idea/scopes/
146+
!/.idea/copyright/
147+
143148
# mypy
144149
.mypy_cache/
145150
.dmypy.json

.idea/copyright/MiraGeoscience.xml

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/copyright/profiles_settings.xml

Lines changed: 25 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/scopes/sources.xml

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.pre-commit-config.yaml

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
default_language_version:
22
python: python3
33
exclude: ^docs/(conf.py|_ext/)
4-
default_stages: [commit,push]
4+
default_stages: [pre-commit,pre-push]
55
fail_fast: false
66

77
ci:
@@ -16,12 +16,12 @@ repos:
1616
- id: poetry-check
1717
args: [--lock]
1818
- repo: https://github.com/hadialqattan/pycln
19-
rev: v2.4.0
19+
rev: v2.5.0
2020
hooks:
2121
- id: pycln
2222
args: [ --config=pyproject.toml ]
2323
- repo: https://github.com/astral-sh/ruff-pre-commit
24-
rev: v0.5.1
24+
rev: v0.9.1
2525
hooks:
2626
- id: ruff
2727
args:
@@ -30,33 +30,43 @@ repos:
3030
# - --unsafe-fixes
3131
- id: ruff-format
3232
- repo: https://github.com/pre-commit/mirrors-mypy
33-
rev: v1.10.1
33+
rev: v1.14.1
3434
hooks:
3535
- id: mypy
3636
additional_dependencies: [
3737
tomli, # to read config from pyproject.toml
3838
]
3939
- repo: https://github.com/codingjoe/relint
40-
rev: 3.1.1
40+
rev: 3.3.1
4141
hooks:
4242
- id: relint
4343
args: [-W] # to fail on warnings
4444
- repo: https://github.com/MiraGeoscience/pre-commit-hooks
45-
rev: v1.0.0
45+
rev: v1.0.2
4646
hooks:
4747
- id: check-copyright
4848
files: (^LICENSE|^README(|-dev).rst|\.py|\.pyi)$
4949
exclude: (^\.|^docs/)
5050
- id: prepare-commit-msg
5151
- id: check-commit-msg
52+
- repo: local
53+
hooks:
54+
- id: pylint
55+
name: pylint
56+
entry: poetry run pylint
57+
language: system
58+
require_serial: true # pylint does its own parallelism
59+
types: [text]
60+
types_or: [python, pyi]
61+
exclude: ^(devtools|docs)/
5262
- repo: https://github.com/codespell-project/codespell
5363
rev: v2.3.0
5464
hooks:
5565
- id: codespell
5666
exclude: (\.lock|\.ipynb|^THIRD_PARTY_SOFTWARE\.rst)$
5767
entry: codespell -I .codespellignore
5868
- repo: https://github.com/pre-commit/pre-commit-hooks
59-
rev: v4.6.0
69+
rev: v5.0.0
6070
hooks:
6171
- id: trailing-whitespace
6272
exclude: \.mdj$

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2024 Mira Geoscience
3+
Copyright (c) 2024-2025 Mira Geoscience
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

README.rst

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@ Usage
2525
Example of ``.pre-commit-config.yamnl``:
2626

2727
.. code:: yaml
28-
repos:
28+
29+
repos:
2930
- repo: http://github.com/MiraGeoscience/pre-commit-hooks
3031
rev: <release>
3132
hooks:
@@ -63,4 +64,4 @@ SOFTWARE.
6364

6465
Copyright
6566
^^^^^^^^^
66-
Copyright (c) 2024 Mira Geoscience Ltd.
67+
Copyright (c) 2024-2025 Mira Geoscience Ltd.

mirageoscience/__init__.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
2+
# Copyright (c) 2024-2025 Mira Geoscience Ltd. '
3+
# '
4+
# This file is part of mirageoscience.pre-commit-hooks package. '
5+
# '
6+
# mirageoscience.pre-commit-hooks is distributed under the terms and conditions '
7+
# of the MIT License (see LICENSE file at the root of this source code package). '
8+
# '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''

mirageoscience/hooks/__init__.py

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
1-
# ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
2-
# Copyright (c) 2024 Mira Geoscience Ltd. '
3-
# '
4-
# This file is part of mirageoscience.pre-commit-hooks package. '
5-
# '
6-
# All rights reserved. '
7-
# ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
1+
# '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
2+
# Copyright (c) 2024-2025 Mira Geoscience Ltd. '
3+
# '
4+
# This file is part of mirageoscience.pre-commit-hooks package. '
5+
# '
6+
# mirageoscience.pre-commit-hooks is distributed under the terms and conditions '
7+
# of the MIT License (see LICENSE file at the root of this source code package). '
8+
# '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
89

9-
__version__ = "1.0.2"
10+
__version__ = "1.1.0"

0 commit comments

Comments
 (0)