Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: pre-commit autoupdate && pre-commit run --all-files #3780

Merged
merged 2 commits into from
Jun 26, 2024
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
2 changes: 1 addition & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ venv
*/node_modules
*/dist
*/data/db
*/mealie/test
*/mealie/test
*/mealie/.temp

model.crfmodel
Expand Down
2 changes: 1 addition & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
*.css linguist-detectable=false
*.html linguist-detectable=false
*.html linguist-detectable=false
2 changes: 1 addition & 1 deletion .github/DISCUSSION_TEMPLATE/oauth-provider-example.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ body:
attributes:
label: Configuration Example
description: Add your example configuration. You can provide code blocks, screenshots, and links.
validations:
validations:
required: true
4 changes: 2 additions & 2 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<!--
This template provides some ideas of things to include in your PR description.

To start, try providing a short summary of your changes in the Title above. We follow Conventional Commits syntax, please ensure your title is prefixed with one of:
- `feat: `
- `fix: `
- `docs: `
- `chore: `

If a section of the PR template does not apply to this PR, then delete that section.

PLEASE READ:
Expand Down
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v2.3.0
rev: v4.6.0
hooks:
- id: check-yaml
exclude: "mkdocs.yml"
Expand All @@ -12,6 +12,6 @@ repos:
exclude: ^tests/data/
- repo: https://github.com/astral-sh/ruff-pre-commit
# Ruff version.
rev: v0.4.3
rev: v0.4.10
hooks:
- id: ruff-format
2 changes: 1 addition & 1 deletion alembic/README
Original file line number Diff line number Diff line change
@@ -1 +1 @@
Generic single-database configuration.
Generic single-database configuration.
2 changes: 1 addition & 1 deletion dev/code-generation/templates/test_data.py.j2
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ CWD = Path(__file__).parent

{% for f in data.children %}
{{ f.var }} = CWD / "{{ f.path }}"
{% endfor %}
{% endfor %}
6 changes: 3 additions & 3 deletions dev/data/templates/recipes.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@
{{ recipe.description }}

## Ingredients
{% for ingredient in recipe.recipeIngredient %}
{% for ingredient in recipe.recipeIngredient %}
- [ ] {{ ingredient }} {% endfor %}

## Instructions
{% for step in recipe.recipeInstructions %}
{% for step in recipe.recipeInstructions %}
- [ ] {{ step.text }} {% endfor %}

{% for note in recipe.notes %}
Expand All @@ -21,4 +21,4 @@

Tags: {{ recipe.tags }}
Categories: {{ recipe.categories }}
Original URL: {{ recipe.orgURL }}
Original URL: {{ recipe.orgURL }}
2 changes: 1 addition & 1 deletion docs/docs/assets/other/n8n/n8n-mealie-backup.json
Original file line number Diff line number Diff line change
Expand Up @@ -383,4 +383,4 @@
},
"id": "whloxeXkdBWWi2Uj",
"tags": []
}
}
2 changes: 1 addition & 1 deletion docs/docs/assets/svg/open-in-new.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 4 additions & 5 deletions docs/docs/contributors/guides/ingredient-parser.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,19 @@
# Improving the Ingredient Parser

Mealie uses Conditional Random Fields (CRFs) for parsing and processing ingredients. The model used for ingredients is based off a data set of over 100,000 ingredients from a dataset compiled by the New York Times. I believe that the model used is sufficient enough to handle most of the ingredients, therefore, more data to train the model won't necessarily help improve the model.
Mealie uses Conditional Random Fields (CRFs) for parsing and processing ingredients. The model used for ingredients is based off a data set of over 100,000 ingredients from a dataset compiled by the New York Times. I believe that the model used is sufficient enough to handle most of the ingredients, therefore, more data to train the model won't necessarily help improve the model.

## Improving The CRF Parser

To improve results with the model, you'll likely need to focus on improving the tokenization and parsing of the original string to aid the model in determine what the ingredient is. Data science is not my forte, but I have done some tokenization to improve the model. You can find that code under `/mealie/services/parser_services/crfpp` along with some other utility functions to aid in the tokenization and processing of ingredient strings.
To improve results with the model, you'll likely need to focus on improving the tokenization and parsing of the original string to aid the model in determine what the ingredient is. Data science is not my forte, but I have done some tokenization to improve the model. You can find that code under `/mealie/services/parser_services/crfpp` along with some other utility functions to aid in the tokenization and processing of ingredient strings.

The best way to test on improving the parser is to register additional test cases in `/mealie/tests/unit_tests/test_crfpp_parser.py` and run the test after making changes to the tokenizer. Note that the test cases DO NOT run in the CI environment, therefore you will need to have CRF++ installed on your machine. If you're using a Mac the easiest way to do this is through brew.

When submitting a PR to improve the parser it is important to provide your test cases, the problem you were trying to solve, and the results of the changes you made. As the tests don't run in CI, not providing these details may delay your PR from being merged.
When submitting a PR to improve the parser it is important to provide your test cases, the problem you were trying to solve, and the results of the changes you made. As the tests don't run in CI, not providing these details may delay your PR from being merged.

## Alternative Parsers
Alternatively, you can register a new parser by fulfilling the `ABCIngredientParser` interface. Satisfying this single method interface allows us to register additional parsing strategies at runtime and gives the user several options when trying to parse a recipe.
Alternatively, you can register a new parser by fulfilling the `ABCIngredientParser` interface. Satisfying this single method interface allows us to register additional parsing strategies at runtime and gives the user several options when trying to parse a recipe.


## Links
- [Pretrained Model](https://github.com/mealie-recipes/mealie-nlp-model)
- [CRF++ (Forked)](https://github.com/hay-kot/crfpp)

6 changes: 3 additions & 3 deletions docs/docs/contributors/non-coders.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ We love your input! We want to make contributing to this project as easy and tra
- Becoming a maintainer
- Help translate to a new language or improve current translations

[Remember to join the Discord and stay in touch with other developers working on the project](https://discord.gg/QuStdQGSGK)!
[Remember to join the Discord and stay in touch with other developers working on the project](https://discord.gg/QuStdQGSGK)!

Additionally, you can buy me a coffee and support the project. When I get financial support it helps me know that there's real interest in the project and that it's worth the time to keep developing.
Additionally, you can buy me a coffee and support the project. When I get financial support it helps me know that there's real interest in the project and that it's worth the time to keep developing.

<a href="https://www.buymeacoffee.com/haykot" target="_blank"><img src="https://cdn.buymeacoffee.com/buttons/v2/default-green.png" alt="Buy Me A Coffee" style="height: 60px !important;width: 217px !important;" ></a>
<a href="https://www.buymeacoffee.com/haykot" target="_blank"><img src="https://cdn.buymeacoffee.com/buttons/v2/default-green.png" alt="Buy Me A Coffee" style="height: 60px !important;width: 217px !important;" ></a>
1 change: 0 additions & 1 deletion docs/docs/documentation/community-guide/bulk-url-import.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,4 +93,3 @@ mealie_url="http://localhost:9000"
token = authentication(mail, password, mealie_url)
import_from_file(input_file, token, mealie_url)
```

2 changes: 1 addition & 1 deletion frontend/.prettierrc
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@
"printWidth": 120,
"arrowParens": "always",
"eslintIntegration": true
}
}
1 change: 0 additions & 1 deletion frontend/components/Domain/User/UserProfileLinkCard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -53,4 +53,3 @@ export default defineComponent({
},
});
</script>

9 changes: 4 additions & 5 deletions frontend/components/README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Components Folder Guide

## Domain Components
Domain Components are specific to the domain or section of a website. For example if you have an admin page and a user page that have specific, unshared elements. These can be placed in the Domain/Admin folder.
Domain Components are specific to the domain or section of a website. For example if you have an admin page and a user page that have specific, unshared elements. These can be placed in the Domain/Admin folder.

**Rules**
- Components should be prefixed with their domain name
Expand All @@ -19,8 +19,8 @@ This folder is for widely reused components that provide little functionality an
The layout folder is for reusable components that are specifically **only** used in the layouts for the Nuxt Application. They may take props or may not. They should be larger layout style components that don't have wide the ability to be widely reused in the application.

**Rules:**
- Layout folder should not have a subfolder
- If they take props they should start with a 'App' Prefix.
- Layout folder should not have a subfolder
- If they take props they should start with a 'App' Prefix.
- Examples: AppSidebar, AppHeader, AppFooter.
- If they do not they should begin with the 'The' prefix
- Examples: TheSidebar, TheHeader, TheFooter.
Expand All @@ -29,7 +29,6 @@ The layout folder is for reusable components that are specifically **only** used
The Page folder is dedicated to 'single-use' component to break up large amounts on content in the pages themselves. A good examples of this is breaking your landing page into separate sections to make it more readable and less monolithic. Page components typically consume other components.

**Rules:**
- These are *last resort* components. Only to be used when the page becomes unmanageable.
- These are *last resort* components. Only to be used when the page becomes unmanageable.
- Page components should be prefixed with their page name
- Examples: HomeAbout, HomeContact, ClientProfile

2 changes: 1 addition & 1 deletion frontend/components/global/DevDumpJson.vue
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@ export default defineComponent({
};
},
});
</script>
</script>
Original file line number Diff line number Diff line change
Expand Up @@ -57,4 +57,4 @@ export function useExtractIngredientReferences(recipeIngredients: RecipeIngredie

return new Set<string>(allMatchedIngredientIds)

}
}
2 changes: 1 addition & 1 deletion frontend/lang/dateTimeFormats/af-ZA.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@
"hour": "numeric",
"minute": "numeric"
}
}
}
2 changes: 1 addition & 1 deletion frontend/lang/dateTimeFormats/ar-SA.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@
"hour": "numeric",
"minute": "numeric"
}
}
}
2 changes: 1 addition & 1 deletion frontend/lang/dateTimeFormats/bg-BG.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@
"hour": "numeric",
"minute": "numeric"
}
}
}
2 changes: 1 addition & 1 deletion frontend/lang/dateTimeFormats/ca-ES.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@
"hour": "numeric",
"minute": "numeric"
}
}
}
2 changes: 1 addition & 1 deletion frontend/lang/dateTimeFormats/cs-CZ.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@
"hour": "numeric",
"minute": "numeric"
}
}
}
2 changes: 1 addition & 1 deletion frontend/lang/dateTimeFormats/el-GR.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@
"hour": "numeric",
"minute": "numeric"
}
}
}
2 changes: 1 addition & 1 deletion frontend/lang/dateTimeFormats/en-GB.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@
"hour": "numeric",
"minute": "numeric"
}
}
}
2 changes: 1 addition & 1 deletion frontend/lang/dateTimeFormats/es-ES.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@
"hour": "numeric",
"minute": "numeric"
}
}
}
2 changes: 1 addition & 1 deletion frontend/lang/dateTimeFormats/fi-FI.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@
"hour": "numeric",
"minute": "numeric"
}
}
}
2 changes: 1 addition & 1 deletion frontend/lang/dateTimeFormats/fr-CA.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@
"hour": "numeric",
"minute": "numeric"
}
}
}
2 changes: 1 addition & 1 deletion frontend/lang/dateTimeFormats/fr-FR.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@
"hour": "numeric",
"minute": "numeric"
}
}
}
2 changes: 1 addition & 1 deletion frontend/lang/dateTimeFormats/he-IL.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@
"hour": "numeric",
"minute": "numeric"
}
}
}
2 changes: 1 addition & 1 deletion frontend/lang/dateTimeFormats/hu-HU.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@
"hour": "numeric",
"minute": "numeric"
}
}
}
2 changes: 1 addition & 1 deletion frontend/lang/dateTimeFormats/ja-JP.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@
"hour": "numeric",
"minute": "numeric"
}
}
}
2 changes: 1 addition & 1 deletion frontend/lang/dateTimeFormats/ko-KR.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@
"hour": "numeric",
"minute": "numeric"
}
}
}
2 changes: 1 addition & 1 deletion frontend/lang/dateTimeFormats/nl-NL.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@
"hour": "numeric",
"minute": "numeric"
}
}
}
2 changes: 1 addition & 1 deletion frontend/lang/dateTimeFormats/no-NO.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@
"hour": "numeric",
"minute": "numeric"
}
}
}
2 changes: 1 addition & 1 deletion frontend/lang/dateTimeFormats/pl-PL.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@
"hour": "numeric",
"minute": "numeric"
}
}
}
2 changes: 1 addition & 1 deletion frontend/lang/dateTimeFormats/pt-BR.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@
"hour": "numeric",
"minute": "numeric"
}
}
}
2 changes: 1 addition & 1 deletion frontend/lang/dateTimeFormats/pt-PT.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@
"hour": "numeric",
"minute": "numeric"
}
}
}
2 changes: 1 addition & 1 deletion frontend/lang/dateTimeFormats/ro-RO.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@
"hour": "numeric",
"minute": "numeric"
}
}
}
2 changes: 1 addition & 1 deletion frontend/lang/dateTimeFormats/ru-RU.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@
"hour": "numeric",
"minute": "numeric"
}
}
}
2 changes: 1 addition & 1 deletion frontend/lang/dateTimeFormats/sk-SK.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@
"hour": "numeric",
"minute": "numeric"
}
}
}
2 changes: 1 addition & 1 deletion frontend/lang/dateTimeFormats/sr-SP.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@
"hour": "numeric",
"minute": "numeric"
}
}
}
2 changes: 1 addition & 1 deletion frontend/lang/dateTimeFormats/sv-SE.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@
"hour": "numeric",
"minute": "numeric"
}
}
}
2 changes: 1 addition & 1 deletion frontend/lang/dateTimeFormats/tr-TR.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@
"hour": "numeric",
"minute": "numeric"
}
}
}
2 changes: 1 addition & 1 deletion frontend/lang/dateTimeFormats/vi-VN.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@
"hour": "numeric",
"minute": "numeric"
}
}
}
2 changes: 1 addition & 1 deletion frontend/lang/dateTimeFormats/zh-CN.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@
"hour": "numeric",
"minute": "numeric"
}
}
}
2 changes: 1 addition & 1 deletion frontend/lang/dateTimeFormats/zh-TW.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@
"hour": "numeric",
"minute": "numeric"
}
}
}
Loading
Loading