Skip to content

Commit 08fc804

Browse files
authored
Merge pull request #99 from zStupan/main
Add formatting and linting via pre-commit hooks
2 parents fdf2322 + bb15b90 commit 08fc804

39 files changed

+1507
-777
lines changed

.github/workflows/test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
strategy:
1414
matrix:
1515
os: [ubuntu-latest, windows-latest, macos-latest]
16-
python-version: ['3.8', '3.9', '3.10', '3.11']
16+
python-version: ['3.9', '3.10', '3.11', '3.12']
1717
defaults:
1818
run:
1919
shell: bash

.pre-commit-config.yaml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
ci:
2+
autofix_prs: true
3+
autoupdate_schedule: monthly
4+
5+
repos:
6+
- repo: https://github.com/pre-commit/pre-commit-hooks
7+
rev: v4.5.0
8+
hooks:
9+
- id: end-of-file-fixer
10+
- id: trailing-whitespace
11+
- id: check-merge-conflict
12+
- id: check-case-conflict
13+
- id: check-toml
14+
- id: check-yaml
15+
- id: check-ast
16+
- id: check-docstring-first
17+
18+
- repo: https://github.com/psf/black-pre-commit-mirror
19+
rev: 23.10.1
20+
hooks:
21+
- id: black
22+
- repo: https://github.com/astral-sh/ruff-pre-commit
23+
rev: v0.1.3
24+
hooks:
25+
- id: ruff
26+
args: [--fix, --exit-non-zero-on-fix]

CODE_OF_CONDUCT.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,11 +119,11 @@ This Code of Conduct is adapted from the [Contributor Covenant][homepage],
119119
version 2.0, available at
120120
[https://www.contributor-covenant.org/version/2/0/code_of_conduct.html][v2.0].
121121

122-
Community Impact Guidelines were inspired by
122+
Community Impact Guidelines were inspired by
123123
[Mozilla's code of conduct enforcement ladder][Mozilla CoC].
124124

125125
For answers to common questions about this code of conduct, see the FAQ at
126-
[https://www.contributor-covenant.org/faq][FAQ]. Translations are available
126+
[https://www.contributor-covenant.org/faq][FAQ]. Translations are available
127127
at [https://www.contributor-covenant.org/translations][translations].
128128

129129
[homepage]: https://www.contributor-covenant.org

docs/_static/output_sample.csv

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@ antecedent,consequent,fitness,support,confidence,lift,coverage,rhs_support,convi
88
"[Rings([1, 29]), Shucked weight([0.001, 1.488])]","[Viscera weight([0.0005, 0.76])]",1.0,1.0,1.0,1.0,1.0,1.0,0.0,0.0,0.3333333333333333,0.9997605937275557,0.5,0.0,-1.0
99
"[Shucked weight([0.001, 1.488]), Rings([1, 29])]","[Whole weight([0.002, 2.8255]), Viscera weight([0.0005, 0.76])]",1.0,1.0,1.0,1.0,1.0,1.0,0.0,0.0,0.4444444444444444,0.9997605937275557,0.6826061944859854,0.0,-1.0
1010
"[Rings([1, 29]), Whole weight([0.002, 2.8255])]","[Viscera weight([0.0005, 0.76])]",1.0,1.0,1.0,1.0,1.0,1.0,0.0,0.0,0.3333333333333333,0.9997605937275557,0.5,0.0,-1.0
11-
"[Shucked weight([0.001, 1.488])]","[Height([0.0, 1.13]), Viscera weight([0.0005, 0.76])]",1.0,1.0,1.0,1.0,1.0,1.0,0.0,0.0,0.3333333333333333,0.9997605937275557,0.7924812503605781,0.0,-1.0
11+
"[Shucked weight([0.001, 1.488])]","[Height([0.0, 1.13]), Viscera weight([0.0005, 0.76])]",1.0,1.0,1.0,1.0,1.0,1.0,0.0,0.0,0.3333333333333333,0.9997605937275557,0.7924812503605781,0.0,-1.0

docs/api/text.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ Text
33

44
.. automodule:: niaarm.text
55
:members:
6-
:show-inheritance:
6+
:show-inheritance:

docs/api/visualize.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ Visualize
33

44
.. automodule:: niaarm.visualize
55
:members:
6-
:show-inheritance:
6+
:show-inheritance:

docs/cli.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,4 +110,3 @@ E.g. (for the above run):
110110
Average length of antecedent: 1.97723292469352
111111
Average length of consequent: 1.5604203152364273
112112
Run Time: 6.4538s
113-

docs/conf.py

Lines changed: 20 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -12,55 +12,61 @@
1212
#
1313
import os
1414
import sys
15+
1516
sys.path.insert(0, os.path.abspath("../"))
1617

1718
# -- Project information -----------------------------------------------------
1819

19-
project = 'NiaARM'
20-
copyright = '2022-2023, Žiga Stupan, Iztok Fister Jr.'
21-
author = 'Žiga Stupan, Iztok Fister Jr.'
20+
project = "NiaARM"
21+
copyright = "2022-2023, Žiga Stupan, Iztok Fister Jr."
22+
author = "Žiga Stupan, Iztok Fister Jr."
2223

2324
# The full version, including alpha/beta/rc tags
24-
release = '0.3.3'
25+
release = "0.3.3"
2526

2627

2728
# -- General configuration ---------------------------------------------------
2829

2930
# Add any Sphinx extension module names here, as strings. They can be
3031
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
3132
# ones.
32-
extensions = ['sphinx.ext.autodoc', 'sphinx_rtd_theme', 'sphinxcontrib.bibtex', 'sphinx.ext.napoleon']
33+
extensions = [
34+
"sphinx.ext.autodoc",
35+
"sphinx_rtd_theme",
36+
"sphinxcontrib.bibtex",
37+
"sphinx.ext.napoleon",
38+
]
3339

3440
# Add any paths that contain templates here, relative to this directory.
35-
templates_path = ['_templates']
41+
templates_path = ["_templates"]
3642

3743
# List of patterns, relative to source directory, that match files and
3844
# directories to ignore when looking for source files.
3945
# This pattern also affects html_static_path and html_extra_path.
40-
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']
46+
exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"]
4147

4248

4349
# -- Options for HTML output -------------------------------------------------
4450

4551
# The theme to use for HTML and HTML Help pages. See the documentation for
4652
# a list of builtin themes.
4753
#
48-
html_theme = 'sphinx_rtd_theme'
54+
html_theme = "sphinx_rtd_theme"
4955

5056
# Add any paths that contain custom static files (such as style sheets) here,
5157
# relative to this directory. They are copied after the builtin static files,
5258
# so a file named "default.css" will overwrite the builtin "default.css".
53-
html_static_path = ['_static']
59+
html_static_path = ["_static"]
5460

5561
# Bibtex
56-
bibtex_bibfiles = ['refs.bib']
62+
bibtex_bibfiles = ["refs.bib"]
5763

5864
# Bibliography style
59-
bibtex_default_style = 'unsrt'
65+
bibtex_default_style = "unsrt"
6066

6167
# Add logo for project
62-
html_logo = '_static/logo.png'
68+
html_logo = "_static/logo.png"
6369
html_theme_options = {
64-
'logo_only': True,
65-
'display_version': False,
70+
"logo_only": True,
71+
"display_version": False,
6672
}

docs/documentation.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@ To locally generate and preview documentation run the following commands in the
88
poetry install --extras docs
99
poetry run sphinx-build ./docs ./docs/_build
1010
11-
If the build of the documentation is successful, you can preview the documentation in the docs/_build folder by clicking the ``index.html`` file.
11+
If the build of the documentation is successful, you can preview the documentation in the docs/_build folder by clicking the ``index.html`` file.

docs/index.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ NiaARM is a minimalistic framework for numerical association rule mining.
77

88
* **Free software:** MIT license
99
* **Github repository:** https://github.com/firefly-cpp/NiaARM
10-
* **Python versions:** 3.7.x, 3.8.x, 3.9.x, 3.10.x, 3.11.x
10+
* **Python versions:** 3.9.x, 3.10.x, 3.11.x, 3.12.x
1111

1212
General outline of the framework
1313
---------------------------------

0 commit comments

Comments
 (0)