Unverified Commit 97e1cf69 authored by AUTOMATIC1111's avatar AUTOMATIC1111 Committed by GitHub
Browse files

Merge branch 'dev' into master

parents 484948f5 bb431df5
Loading
Loading
Loading
Loading

.eslintignore

0 → 100644
+4 −0
Original line number Diff line number Diff line
extensions
extensions-disabled
repositories
venv
 No newline at end of file

.eslintrc.js

0 → 100644
+89 −0
Original line number Diff line number Diff line
module.exports = {
    env: {
        browser: true,
        es2021: true,
    },
    extends: "eslint:recommended",
    parserOptions: {
        ecmaVersion: "latest",
    },
    rules: {
        "arrow-spacing": "error",
        "block-spacing": "error",
        "brace-style": "error",
        "comma-dangle": ["error", "only-multiline"],
        "comma-spacing": "error",
        "comma-style": ["error", "last"],
        "curly": ["error", "multi-line", "consistent"],
        "eol-last": "error",
        "func-call-spacing": "error",
        "function-call-argument-newline": ["error", "consistent"],
        "function-paren-newline": ["error", "consistent"],
        "indent": ["error", 4],
        "key-spacing": "error",
        "keyword-spacing": "error",
        "linebreak-style": ["error", "unix"],
        "no-extra-semi": "error",
        "no-mixed-spaces-and-tabs": "error",
        "no-trailing-spaces": "error",
        "no-whitespace-before-property": "error",
        "object-curly-newline": ["error", {consistent: true, multiline: true}],
        "quote-props": ["error", "consistent-as-needed"],
        "semi": ["error", "always"],
        "semi-spacing": "error",
        "semi-style": ["error", "last"],
        "space-before-blocks": "error",
        "space-before-function-paren": ["error", "never"],
        "space-in-parens": ["error", "never"],
        "space-infix-ops": "error",
        "space-unary-ops": "error",
        "switch-colon-spacing": "error",
        "template-curly-spacing": ["error", "never"],
        "unicode-bom": "error",
        "no-multi-spaces": "error",
        "object-curly-spacing": ["error", "never"],
        "operator-linebreak": ["error", "after"],
        "no-unused-vars": "off",
        "no-redeclare": "off",
    },
    globals: {
        // this file
        module: "writable",
        //script.js
        gradioApp: "writable",
        onUiLoaded: "writable",
        onUiUpdate: "writable",
        onOptionsChanged: "writable",
        uiCurrentTab: "writable",
        uiElementIsVisible: "writable",
        executeCallbacks: "writable",
        //ui.js
        opts: "writable",
        all_gallery_buttons: "writable",
        selected_gallery_button: "writable",
        selected_gallery_index: "writable",
        args_to_array: "writable",
        switch_to_txt2img: "writable",
        switch_to_img2img_tab: "writable",
        switch_to_img2img: "writable",
        switch_to_sketch: "writable",
        switch_to_inpaint: "writable",
        switch_to_inpaint_sketch: "writable",
        switch_to_extras: "writable",
        get_tab_index: "writable",
        create_submit_args: "writable",
        restart_reload: "writable",
        updateInput: "writable",
        //extraNetworks.js
        requestGet: "writable",
        popup: "writable",
        // from python
        localization: "writable",
        // progrssbar.js
        randomId: "writable",
        requestProgress: "writable",
        // imageviewer.js
        modalPrevImage: "writable",
        modalNextImage: "writable",
    }
};
+21 −0
Original line number Diff line number Diff line
@@ -47,6 +47,15 @@ body:
      description: Which commit are you running ? (Do not write *Latest version/repo/commit*, as this means nothing and will have changed by the time we read your issue. Rather, copy the **Commit** link at the bottom of the UI, or from the cmd/terminal if you can't launch it.)
    validations:
      required: true
  - type: dropdown
    id: py-version
    attributes:
      label: What Python version are you running on ?
      multiple: false
      options:
        - Python 3.10.x
        - Python 3.11.x (above, no supported yet)
        - Python 3.9.x (below, no recommended)
  - type: dropdown
    id: platforms
    attributes:
@@ -59,6 +68,18 @@ body:
        - iOS
        - Android
        - Other/Cloud
  - type: dropdown
    id: device
    attributes:
        label: What device are you running WebUI on?
        multiple: true
        options:
        - Nvidia GPUs (RTX 20 above)
        - Nvidia GPUs (GTX 16 below)
        - AMD GPUs (RX 6000 above)
        - AMD GPUs (RX 5000 below)
        - CPU
        - Other GPUs
  - type: dropdown
    id: browsers
    attributes:
+22 −27
Original line number Diff line number Diff line
# See https://github.com/actions/starter-workflows/blob/1067f16ad8a1eac328834e4b0ae24f7d206f810d/ci/pylint.yml for original reference file
name: Run Linting/Formatting on Pull Requests

on:
  - push
  - pull_request
  # See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#onpull_requestpull_request_targetbranchesbranches-ignore for syntax docs
  # if you want to filter out branches, delete the `- pull_request` and uncomment these lines :
  # pull_request:  
  #  branches:
  #    - master
  #  branches-ignore:
  #    - development

jobs:
  lint:
  lint-python:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout Code
        uses: actions/checkout@v3
      - name: Set up Python 3.10
        uses: actions/setup-python@v4
      - uses: actions/setup-python@v4
        with:
          python-version: 3.10.6
          cache: pip
          cache-dependency-path: |
            **/requirements*txt
      - name: Install PyLint
        run: | 
          python -m pip install --upgrade pip
          pip install pylint
      # This lets PyLint check to see if it can resolve imports
      - name: Install dependencies
        run: |
          export COMMANDLINE_ARGS="--skip-torch-cuda-test --exit"
          python launch.py
      - name: Analysing the code with pylint
        run: |
          pylint $(git ls-files '*.py')
          python-version: 3.11
          # NB: there's no cache: pip here since we're not installing anything
          #     from the requirements.txt file(s) in the repository; it's faster
          #     not to have GHA download an (at the time of writing) 4 GB cache
          #     of PyTorch and other dependencies.
      - name: Install Ruff
        run: pip install ruff==0.0.265
      - name: Run Ruff
        run: ruff .
  lint-js:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout Code
        uses: actions/checkout@v3
      - name: Install Node.js
        uses: actions/setup-node@v3
        with:
          node-version: 18
      - run: npm i --ci
      - run: npm run lint
+6 −0
Original line number Diff line number Diff line
@@ -17,8 +17,14 @@ jobs:
          cache: pip
          cache-dependency-path: |
            **/requirements*txt
            launch.py
      - name: Run tests
        run: python launch.py --tests test --no-half --disable-opt-split-attention --use-cpu all --skip-torch-cuda-test
        env:
          PIP_DISABLE_PIP_VERSION_CHECK: "1"
          PIP_PROGRESS_BAR: "off"
          TORCH_INDEX_URL: https://download.pytorch.org/whl/cpu
          WEBUI_LAUNCH_LIVE_OUTPUT: "1"
      - name: Upload main app stdout-stderr
        uses: actions/upload-artifact@v3
        if: always()
Loading