From b104fc00f962140c6a104a85450f8e0a4322aac8 Mon Sep 17 00:00:00 2001 From: Ashwin Vaidya Date: Tue, 29 Nov 2022 08:50:56 +0100 Subject: [PATCH] Migrate markdownlint + issue templates (#738) * Migrate to different markdown linter + format files based on it * Migrate to bug report forms * Update template with os information * Migrate feature requests * Migrate feature requests * Fix link * Update template * New line * Add change log * Add folder and model options to bug report template * Set required to true * Description field from markdown to textarea --- .github/ISSUE_TEMPLATE/bug_report.md | 40 ------ .github/ISSUE_TEMPLATE/bug_report.yaml | 129 ++++++++++++++++++++ .github/ISSUE_TEMPLATE/feature_request.md | 23 ---- .github/ISSUE_TEMPLATE/feature_request.yaml | 35 ++++++ .markdownlint.yaml | 34 ++++++ .mdlrc | 1 - .pre-commit-config.yaml | 4 +- CHANGELOG.md | 14 +-- README.md | 2 +- anomalib/models/fastflow/README.md | 8 +- markdownlint.rb | 62 ---------- 11 files changed, 209 insertions(+), 143 deletions(-) delete mode 100644 .github/ISSUE_TEMPLATE/bug_report.md create mode 100644 .github/ISSUE_TEMPLATE/bug_report.yaml delete mode 100644 .github/ISSUE_TEMPLATE/feature_request.md create mode 100644 .github/ISSUE_TEMPLATE/feature_request.yaml create mode 100644 .markdownlint.yaml delete mode 100644 .mdlrc delete mode 100644 markdownlint.rb diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md deleted file mode 100644 index 2ab3790b9c..0000000000 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ /dev/null @@ -1,40 +0,0 @@ ---- -name: Bug report -about: Create a report to help us improve -title: "" -labels: "" -assignees: "" ---- - -**Describe the bug** - -- A clear and concise description of what the bug is. - -**To Reproduce** - -Steps to reproduce the behavior: - -1. Go to '...' -1. Click on '....' -1. Scroll down to '....' -1. See error - -**Expected behavior** - -- A clear and concise description of what you expected to happen. - -**Screenshots** - -- If applicable, add screenshots to help explain your problem. - -**Hardware and Software Configuration** - -- OS: [Ubuntu, OD] -- NVIDIA Driver Version [470.57.02] -- CUDA Version [e.g. 11.4] -- CUDNN Version [e.g. v11.4.120] -- OpenVINO Version [Optional e.g. v2021.4.2] - -**Additional context** - -- Add any other context about the problem here. diff --git a/.github/ISSUE_TEMPLATE/bug_report.yaml b/.github/ISSUE_TEMPLATE/bug_report.yaml new file mode 100644 index 0000000000..a64db572e7 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.yaml @@ -0,0 +1,129 @@ +name: Bug Report +description: Create a report to help us improve +title: "[Bug]: " +body: + - type: textarea + id: description + attributes: + label: Describe the bug + description: | + A clear and concise description of what the bug is. + + > *__Note:__* Please do not submit support requests or "How to" questions here. Instead, please use our [Discussion forum](https://github.com/openvinotoolkit/anomalib/discussions/categories/q-a) + validations: + required: true + - type: dropdown + id: dataset + attributes: + label: Dataset + description: Which Dataset are you using? + options: + - N/A + - "Avenue" + - "BTec" + - "Folder" + - "MVTec" + - "UCSD" + - "Other (please specify in the text field below)" + validations: + required: true + - type: dropdown + id: model + attributes: + label: Model + description: Which model are you using? + options: + - N/A + - "CFlow" + - "CSFlow" + - "DFKDE" + - "DFM" + - "DRAEM" + - "FastFlow" + - "GANomaly" + - "PADiM" + - "PatchCore" + - "Reverse Distillation" + - "STFPM" + - "Other (please specify in the field below)" + validations: + required: true + - type: textarea + id: to-reproduce + attributes: + label: Steps to reproduce the behavior + description: Detailed steps or any other information you think is useful to reproduce the behavior. + placeholder: | + Steps to reproduce the behavior: + 1. Install anomalib using '...' + 2. Use/modify config '....' + 3. Run using command '....' + 4. See error + validations: + required: true + - type: textarea + id: os-information + attributes: + label: OS information + description: If you think OS information is necessary to reproduce the behavior, please provide it here. + value: | + OS information: + - OS: [e.g. Ubuntu 20.04] + - Python version: [e.g. 3.8.10] + - Anomalib version: [e.g. 0.3.6] + - PyTorch version: [e.g. 1.9.0] + - CUDA/cuDNN version: [e.g. 11.1] + - GPU models and configuration: [e.g. 2x GeForce RTX 3090] + - Any other relevant information: [e.g. I'm using a custom dataset] + validations: + required: true + - type: textarea + id: expected-behavior + attributes: + label: Expected behavior + description: A clear and concise description of what you expected to happen. + validations: + required: true + - type: textarea + id: screenshots + attributes: + label: Screenshots + description: If applicable, add screenshots to help explain your problem. + - type: dropdown + id: source + attributes: + label: Pip/GitHub + description: Did you install Anomalib from pip or from GitHub? + options: + - pip + - GitHub + validations: + required: true + - type: input + id: version-branch + attributes: + label: What version/branch did you use? + - type: textarea + id: config + attributes: + label: Configuration YAML + description: Please paste your configuration YAML here. + render: yaml + validations: + required: true + - type: textarea + id: logs + attributes: + label: Logs + description: Please paste your logs here. + render: shell + validations: + required: true + - type: checkboxes + id: terms + attributes: + label: Code of Conduct + description: By submitting this issue, you agree to follow our [Code of Conduct](https://github.com/openvinotoolkit/anomalib/blob/main/CODE_OF_CONDUCT.md) + options: + - label: I agree to follow this project's Code of Conduct + required: true diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md deleted file mode 100644 index 2d66710054..0000000000 --- a/.github/ISSUE_TEMPLATE/feature_request.md +++ /dev/null @@ -1,23 +0,0 @@ ---- -name: Feature request -about: Suggest an idea for this project -title: "" -labels: "" -assignees: "" ---- - -**Is your feature request related to a problem? Please describe.** - -- A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] - -**Describe the solution you'd like** - -- A clear and concise description of what you want to happen. - -**Describe alternatives you've considered** - -- A clear and concise description of any alternative solutions or features you've considered. - -**Additional context** - -- Add any other context or screenshots about the feature request here. diff --git a/.github/ISSUE_TEMPLATE/feature_request.yaml b/.github/ISSUE_TEMPLATE/feature_request.yaml new file mode 100644 index 0000000000..edae1283bc --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature_request.yaml @@ -0,0 +1,35 @@ +name: Feature Request +description: Suggest an idea for this project +title: "[Feature Request]: " +labels: ["Feature Request"] +body: + - type: markdown + attributes: + value: | + We encourage our users to submit feature requests in our [Discussion forum](https://github.com/openvinotoolkit/anomalib/discussions/categories/ideas-feature-requests). You can use this template for consistency. + + - type: textarea + id: concern + attributes: + label: Is your feature request related to a problem? + description: A clear and concise description of what the problem is. + placeholder: | + 1. I'm always frustrated when [...]. It would be better if we could [...] + 2. I would like to have [...] model/dataset to be supported in Anomalib. + validations: + required: true + - type: textarea + id: solution + attributes: + label: Describe the solution you'd like + description: A clear and concise description of what you want to happen. Add screenshots or code-blocks if necessary. + placeholder: | + I would like to have [...] to do this we would need to [...] + Here is what I would like to see [...] + validations: + required: true + - type: textarea + id: additional-context + attributes: + label: Additional context + description: Add any other context or screenshots about the feature request here. diff --git a/.markdownlint.yaml b/.markdownlint.yaml new file mode 100644 index 0000000000..fd29d486e9 --- /dev/null +++ b/.markdownlint.yaml @@ -0,0 +1,34 @@ +# Default state for all rules +default: true + +# Path to configuration file to extend +extends: null + +# MD001/heading-increment/header-increment - Heading levels should only increment by one level at a time +MD001: true + +# MD013/line-length - Line length +MD013: + # Number of characters + line_length: 1000 + +# This is not useful for some files such as `CHANGELOG.md` +MD024: + # Only check sibling headings + allow_different_nesting: true + # Only check sibling headings + siblings_only: true + +MD033: false + +# If a page is printed, it helps if the URL is viewable. +MD034: false # Bare URL used + +# This is needed for the anomalib tagline in the README +MD036: false # Emphasis used instead of a header + +# Some md files have comments or links at the top of the files. +MD041: false # First line in file should be a top level header + +# Badges have empty links +MD042: false # No empty links diff --git a/.mdlrc b/.mdlrc deleted file mode 100644 index 840a3e398d..0000000000 --- a/.mdlrc +++ /dev/null @@ -1 +0,0 @@ -style "#{File.dirname(__FILE__)}/markdownlint.rb" diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 2e866a4cb6..f95fd4c85f 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -78,8 +78,8 @@ repos: hooks: - id: prettier - - repo: https://github.com/jumanjihouse/pre-commit-hooks - rev: 2.1.6 + - repo: https://github.com/igorshubovych/markdownlint-cli + rev: v0.32.2 hooks: - id: markdownlint diff --git a/CHANGELOG.md b/CHANGELOG.md index d881116645..f80c6ca0db 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,7 @@ ## v0.3.7 -## What's Changed +### What's Changed - Feature/comet logging by @sherpan in - 🐞 Fix linting issues by @ashwinvaidya17 in @@ -47,7 +47,7 @@ New Contributors ## v.0.3.6 -## What's Changed +### What's Changed - Add publish workflow + update references to main by @ashwinvaidya17 in - Fix Dockerfile by @ORippler in @@ -85,7 +85,7 @@ New Contributors ## v.0.3.5 -## What's Changed +### What's Changed - 🐞 Fix inference for draem by @djdameln in - 🐞 🛠 Bug fix in the inferencer by @samet-akcay in @@ -94,7 +94,7 @@ New Contributors ## v.0.3.4 -## What's Changed +### What's Changed - Add encoding to LONG_DESCRIPTION in setup.py by @samet-akcay in - Fix visualization by @ORippler in @@ -130,7 +130,7 @@ New Contributors ## v.0.3.3 -## What's Changed +### What's Changed - 🚚 Move initialization log message to base class by @djdameln in - 🚚 Move logging from train.py to the getter functions by @samet-akcay in @@ -155,7 +155,7 @@ New Contributors ## v.0.3.2 -## What's Changed +### What's Changed - Refactor `AnomalyModule` and `LightningModules` to explicitly define class arguments. by @samet-akcay in - 🐞 Fix inferencer in Gradio by @ashwinvaidya17 in @@ -176,7 +176,7 @@ New Contributors ## v.0.3.1 -## What's Changed +### What's Changed - 🔧 Properly assign values to dataframe in folder dataset. by @samet-akcay in - ➕ Add warnings ⚠️ for inproper task setting in config files. by @samet-akcay in diff --git a/README.md b/README.md index 20ba7cabaf..6c161c2ed8 100644 --- a/README.md +++ b/README.md @@ -33,7 +33,7 @@ Anomalib is a deep learning library that aims to collect state-of-the-art anomal ![Sample Image](./docs/source/images/readme.png) -**Key features:** +## Key features - The largest public collection of ready-to-use deep learning anomaly detection algorithms and benchmark datasets. - [**PyTorch Lightning**](https://www.pytorchlightning.ai/) based model implementations to reduce boilerplate code and limit the implementation efforts to the bare essentials. diff --git a/anomalib/models/fastflow/README.md b/anomalib/models/fastflow/README.md index 057269f359..8866337000 100644 --- a/anomalib/models/fastflow/README.md +++ b/anomalib/models/fastflow/README.md @@ -22,13 +22,7 @@ All results gathered with seed `0`. ## [MVTec AD Dataset](https://www.mvtec.com/company/research/datasets/mvtec-ad) ---- - -**NOTE** - -When the numbers are produced, early stopping callback (patience: 3) is used. It might be possible to achieve higher-metrics by increasing the patience. - ---- +> **_NOTE:_** When the numbers are produced, early stopping callback (patience: 3) is used. It might be possible to achieve higher-metrics by increasing the patience. ### Image-Level AUC diff --git a/markdownlint.rb b/markdownlint.rb deleted file mode 100644 index 4515a6a379..0000000000 --- a/markdownlint.rb +++ /dev/null @@ -1,62 +0,0 @@ -################################################################################ -# Modified using -# https://github.com/jumanjihouse/pre-commit-hooks/blob/master/ci/jumanjistyle.rb -################################################################################ - - -# frozen_string_literal: true - -################################################################################ -# Style file for markdownlint. -# -# https://github.com/markdownlint/markdownlint/blob/master/docs/configuration.md -# -# This file is referenced by the project `.mdlrc`. -################################################################################ - -#=============================================================================== -# Start with all built-in rules. -# https://github.com/markdownlint/markdownlint/blob/master/docs/RULES.md -all - -#=============================================================================== -# Override default parameters for some built-in rules. -# https://github.com/markdownlint/markdownlint/blob/master/docs/creating_styles.md#parameters - -# Allow both fenced and indented code blocks. -# rule 'MD046', style: ['fenced', 'indented'] - -# Ignore line length in code blocks. -rule 'MD013', :line_length => 1000 -# rule 'MD013', code_blocks: false - -#=============================================================================== -# Exclude the rules I disagree with. - -# IMHO it's easier to read lists like: -# * outmost indent -# - one indent -# - second indent -# * Another major bullet -exclude_rule 'MD004' # Unordered list style - -# I prefer two blank lines before each heading. -exclude_rule 'MD012' # Multiple consecutive blank lines - -# This is not useful for some files such as `CHANGELOG.md` -exclude_rule 'MD024' # Multiple headers with the same content - -# I find it necessary to use '
' to force line breaks. -exclude_rule 'MD033' # Inline HTML - -# If a page is printed, it helps if the URL is viewable. -exclude_rule 'MD034' # Bare URL used - -# Some md files have comments or links at the top of the files. -exclude_rule 'MD041' # First line in file should be a top level header - -#=============================================================================== -# Exclude rules for pragmatic reasons. - -# Either disable this one or MD024 - Multiple headers with the same content. -exclude_rule 'MD036' # Emphasis used instead of a header