Skip to content
Merged
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
24 changes: 24 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
root = true

[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
[*.md]
trim_trailing_whitespace = false

[*.{rb,rake,gemspec,rbs,ru}]
indent_style = space
indent_size = 2

[*.{yml,yaml,json}]
indent_style = space
indent_size = 2

[*.sh]
indent_style = space
indent_size = 2

[Makefile]
indent_style = tab
16 changes: 16 additions & 0 deletions .github/workflows/_static-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,22 @@ jobs:
ruby-version: "3.0.0"
bundler-cache: true

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.x"

- name: Install pre-commit
run: |
python -m pip install --upgrade pip
python -m pip install pre-commit

- name: Run pre-commit checks (security + hygiene)
env:
SKIP: rubocop,steep
run: |
pre-commit run --all-files --show-diff-on-failure

- name: Analyse the code with Rubocop
run: |
bundle install
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/_test-cli.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ jobs:

- name: Tests V2 CLI
run: |
./spec/test_v2_cli.sh ./spec/data/file_types/pdf/blank_1.pdf ${{ matrix.os_config.rid }}
./spec/test_v2_cli.sh ./spec/data/file_types/pdf/blank_1.pdf ${{ matrix.os_config.rid }}

- name: Tests V1 CLI
run: |
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/_test-smoke.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,4 +52,3 @@ jobs:
MINDEE_LOG_LEVEL: DEBUG
run: |
./spec/test_v1_code_samples.sh ${{ secrets.MINDEE_ACCOUNT_SE_TESTS }} ${{ secrets.MINDEE_ENDPOINT_SE_TESTS }}

36 changes: 36 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v6.0.0
hooks:
- id: check-merge-conflict
- id: check-yaml
- id: end-of-file-fixer
- id: trailing-whitespace
- id: check-added-large-files
args: ["--maxkb=1024"]

- repo: https://github.com/gitleaks/gitleaks
rev: v8.30.0
hooks:
- id: gitleaks
exclude: ^(spec/data/|docs/code_samples/|local_test/)

- repo: local
hooks:
- id: rubocop
name: RuboCop
entry: bundle exec rubocop --force-exclusion --no-server
language: system
pass_filenames: false
- id: steep
name: Steep
entry: bundle exec steep check
language: system
pass_filenames: false
stages: [pre-commit, pre-push]
- id: bundle-audit
name: Bundle Audit
entry: bundle exec bundle-audit check
language: system
pass_filenames: false
stages: [pre-commit, pre-push]
6 changes: 3 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
* :recycle: make polling follow API urls instead of re-constructing them
* :sparkles: add support for generic product accessors in V2
* :recycle: add proper tests for ruby 4
### Fixes
* :recycle: fix tests file paths
### Fixes
* :recycle: fix tests file paths


## v4.12.0 - 2026-02-25
Expand Down Expand Up @@ -58,7 +58,7 @@


## v4.7.0 - 2025-09-18
Including RC changes and fixes.
Including RC changes and fixes.
### Changes
* :sparkles: add support for V2 Mindee API
* :sparkles: add missing accessors for PDF fixing options in `LocalInputSource`
Expand Down
17 changes: 17 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,3 +88,20 @@ Examples:

We keep our code base consistent and expect Ruby code to adhere to our Rubocop styleguide,
see the `.rubocop` file.

### Local Quality Checks

We use [`pre-commit`](https://pre-commit.com/) hooks to run quality and security checks before
changes are pushed:

1. Install `pre-commit`, either using `pip` or `brew`:
- `pip install pre-commit`
- `brew install pre-commit`
2. Install project hooks:
- `pre-commit install`
- `pre-commit install --hook-type pre-push`

Run hooks manually:

* `pre-commit run --all-files`
* `pre-commit run --all-files --hook-stage pre-push`
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,4 @@ Consult the
### License
Copyright © Mindee

Available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
Available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
1 change: 0 additions & 1 deletion Steepfile
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,3 @@ target :lib do

configure_code_diagnostics(D::Ruby.default) # `default` diagnostics setting (applies by default)
end

1 change: 0 additions & 1 deletion docs/code_samples/default_async.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,3 @@ result = mindee_client.parse(

# Print a full summary of the parsed data in RST format
puts result.document

2 changes: 1 addition & 1 deletion docs/code_samples/v2_crop.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,4 @@ response = mindee_client.enqueue_and_get_result(
)

# Access the result crops
puts response.inference.result.crops
puts response.inference.result.crops
1 change: 0 additions & 1 deletion docs/code_samples/workflow_polling.txt
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,3 @@ result = mindee_client.parse(

# Print a full summary of the parsed data in RST format
puts result.document

1 change: 0 additions & 1 deletion lib/mindee/http/.rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,3 @@ Metrics/CyclomaticComplexity:

Metrics/PerceivedComplexity:
Max: 10

1 change: 0 additions & 1 deletion lib/mindee/v1/http/.rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,3 @@ Metrics/CyclomaticComplexity:

Metrics/PerceivedComplexity:
Max: 10

1 change: 0 additions & 1 deletion lib/mindee/v2/http/.rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,3 @@ Metrics/CyclomaticComplexity:

Metrics/PerceivedComplexity:
Max: 10

1 change: 1 addition & 0 deletions mindee.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ Gem::Specification.new do |spec|
spec.required_ruby_version = Gem::Requirement.new('>= 3.0')

spec.add_dependency 'base64', '~> 0.1'
spec.add_dependency 'bundle-audit', '~> 0.2.0'
spec.add_dependency 'marcel', '~> 1.0'
spec.add_dependency 'mini_magick', '>= 4', '< 6'
spec.add_dependency 'origamindee', '~> 4.0'
Expand Down
2 changes: 1 addition & 1 deletion sig/custom/marcel.rbs
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module Marcel
MimeType: untyped
end
end
2 changes: 1 addition & 1 deletion sig/custom/net_http.rbs
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,4 @@ module Net
def body: -> untyped
def code: -> String?
end
end
end
2 changes: 1 addition & 1 deletion sig/custom/origami.rbs
Original file line number Diff line number Diff line change
Expand Up @@ -56,4 +56,4 @@ module Origami
def data= : (String | StringIO) -> void
def dictionary : -> Hash[Symbol, untyped]
end
end
end
1 change: 0 additions & 1 deletion sig/mindee.rbs
Original file line number Diff line number Diff line change
Expand Up @@ -60,4 +60,3 @@ module Mindee
end
end
end

2 changes: 1 addition & 1 deletion sig/mindee/v1/parsing/common/extras/rag_extra.rbs
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ module Mindee
end
end
end
end
end
1 change: 0 additions & 1 deletion sig/mindee/v2/parsing/inference_file.rbs
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,3 @@ module Mindee
end
end
end

Loading