Skip to content

Commit

Permalink
Merge pull request #103 from lalithkota/17.0-develop
Browse files Browse the repository at this point in the history
Fixed precommit errors,formatting and configs according to 17.0
  • Loading branch information
shibu-narayanan authored Apr 3, 2024
2 parents 94bc577 + af847cb commit c8db833
Show file tree
Hide file tree
Showing 37 changed files with 225 additions and 404 deletions.
11 changes: 6 additions & 5 deletions .copier-answers.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
# Do NOT update manually; changes here will be overwritten by Copier
_commit: v1.20
_src_path: https://github.com/OCA/oca-addons-repo-template.git
additional_ruff_rules: []
ci: GitHub
convert_readme_fragments_to_markdown: false
generate_requirements_txt: true
github_check_license: false
github_ci_extra_env: {}
github_enable_codecov: false
github_enable_makepot: false
github_enable_codecov: true
github_enable_makepot: true
github_enable_stale_action: false
github_enforce_dev_status_compatibility: false
include_wkhtmltopdf: false
odoo_test_flavor: Odoo
odoo_test_flavor: Both
odoo_version: 17.0
org_name: OpenG2P
org_slug: OpenG2P
Expand All @@ -20,6 +21,6 @@ repo_description: Self Service Portal
repo_name: OpenG2P Self Service Portal
repo_slug: openg2p-self-service-portal
repo_website: https://github.com/OpenG2P/openg2p-self-service-portal
use_pyproject_toml: false
use_ruff: false
use_pyproject_toml: true
use_ruff: true

1 change: 0 additions & 1 deletion .eslintrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ parserOptions:

overrides:
- files:
- "**/*.esm.js"
- "**/*.js"
parserOptions:
sourceType: module
Expand Down
12 changes: 0 additions & 12 deletions .flake8

This file was deleted.

14 changes: 0 additions & 14 deletions .github/workflows/pre-commit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,7 @@ name: pre-commit

on:
pull_request:
branches:
- "17.0*"
push:
branches:
- "17.0"
- "17.0-ocabot-*"

jobs:
pre-commit:
Expand All @@ -27,15 +22,6 @@ jobs:
run: pip install pre-commit
- name: Run pre-commit
run: pre-commit run --all-files --show-diff-on-failure --color=always
env:
# Consider valid a PR that changes README fragments but doesn't
# change the README.rst file itself. It's not really a problem
# because the bot will update it anyway after merge. This way, we
# lower the barrier for functional contributors that want to fix the
# readme fragments, while still letting developers get README
# auto-generated (which also helps functionals when using runboat).
# DOCS https://pre-commit.com/#temporarily-disabling-hooks
SKIP: oca-gen-addon-readme
- name: Check that all files generated by pre-commit are in git
run: |
newfiles="$(git ls-files --others --exclude-from=.gitignore)"
Expand Down
51 changes: 39 additions & 12 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,18 @@ name: tests
on:
pull_request:
branches:
- "17.0*"
- "15.0*"
- "17.0*"
push:
branches:
- "17.0"
- "17.0-ocabot-*"

- "15.0*"
- "17.0*"
env:
OCA_GIT_USER_NAME: openg2p
OCA_GIT_USER_EMAIL: [email protected]
jobs:
unreleased-deps:
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
name: Detect unreleased dependencies
steps:
- uses: actions/checkout@v3
Expand All @@ -28,19 +30,44 @@ jobs:
fi
fi
done
matrix_prep:
runs-on: ubuntu-22.04
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
steps:
- id: set-matrix
run: |
BRANCH_NAME=$(echo ${{ github.base_ref || github.ref }} | sed -e 's,.*/\(.*\),\1,')
if [[ $BRANCH_NAME = 15.0* ]] ; then
matrix='{"include": [{
"container": "ghcr.io/oca/oca-ci/py3.8-odoo15.0:latest",
"makepot": "true",
"name": "test with Odoo 15"
},{
"container": "ghcr.io/oca/oca-ci/py3.8-ocb15.0:latest",
"name": "test with OCB 15"
}]}'
elif [[ $BRANCH_NAME = 17.0* ]] ; then
matrix='{"include": [{
"container": "ghcr.io/oca/oca-ci/py3.10-odoo17.0:latest",
"makepot": "true",
"name": "test with Odoo 17"
},{
"container": "ghcr.io/oca/oca-ci/py3.10-ocb17.0:latest",
"name": "test with OCB 17"
}]}'
fi
echo "matrix=$matrix" | tr -d '\n' >> $GITHUB_OUTPUT
test:
runs-on: ubuntu-latest
needs: matrix_prep
runs-on: ubuntu-22.04
container: ${{ matrix.container }}
name: ${{ matrix.name }}
permissions:
contents: write
strategy:
fail-fast: false
matrix:
include:
- container: ghcr.io/oca/oca-ci/py3.10-odoo17.0:latest
name: test with Odoo
makepot: "false"
matrix: ${{fromJson(needs.matrix_prep.outputs.matrix)}}
services:
postgres:
image: postgres:12.0
Expand All @@ -51,7 +78,6 @@ jobs:
ports:
- 5432:5432
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v3
with:
persist-credentials: false
Expand All @@ -67,6 +93,7 @@ jobs:
run: oca_init_test_database
- name: Run tests
run: oca_run_tests
- uses: codecov/codecov-action@v1
- name: Update .pot files
run: oca_export_and_push_pot https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}
if: ${{ matrix.makepot == 'true' && github.event_name == 'push' && github.repository_owner == 'openg2p' }}
13 changes: 0 additions & 13 deletions .isort.cfg

This file was deleted.

58 changes: 13 additions & 45 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,41 +36,32 @@ repos:
entry: found a en.po file
language: fail
files: '[a-zA-Z0-9_]*/i18n/en\.po$'
- repo: https://github.com/sbidoul/whool
rev: v0.5
hooks:
- id: whool-init
- repo: https://github.com/oca/maintainer-tools
rev: 9a170331575a265c092ee6b24b845ec508e8ef75
hooks:
# update the NOT INSTALLABLE ADDONS section above
- id: oca-update-pre-commit-excluded-addons
- id: oca-fix-manifest-website
args: ["https://github.com/OpenG2P/openg2p-self-service-portal"]
args: ["https://openg2p.org"]
- id: oca-gen-addon-readme
args:
- --addons-dir=.
- --branch=17.0
- --branch=17.0-develop
- --org-name=OpenG2P
- --repo-name=openg2p-self-service-portal
- --if-source-changed
- --keep-source-digest
- id: oca-gen-addons-table
- id: oca-gen-external-dependencies
- repo: https://github.com/OCA/odoo-pre-commit-hooks
rev: v0.0.25
hooks:
- id: oca-checks-odoo-module
- id: oca-checks-po
- repo: https://github.com/myint/autoflake
rev: v1.6.1
hooks:
- id: autoflake
args:
- --expand-star-imports
- --ignore-init-module-imports
- --in-place
- --remove-all-unused-imports
- --remove-duplicate-keys
- --remove-unused-variables
- repo: https://github.com/psf/black
rev: 22.8.0
hooks:
- id: black
- repo: https://github.com/pre-commit/mirrors-prettier
rev: v2.7.1
hooks:
Expand Down Expand Up @@ -112,35 +103,12 @@ repos:
- id: check-xml
- id: mixed-line-ending
args: ["--fix=lf"]
- repo: https://github.com/asottile/pyupgrade
rev: v2.38.2
hooks:
- id: pyupgrade
args: ["--keep-percent-format"]
- repo: https://github.com/PyCQA/isort
rev: 5.12.0
hooks:
- id: isort
name: isort except __init__.py
args:
- --settings=.
exclude: /__init__\.py$
- repo: https://github.com/acsone/setuptools-odoo
rev: 3.1.8
hooks:
- id: setuptools-odoo-make-default
- id: setuptools-odoo-get-requirements
args:
- --output
- requirements.txt
- --header
- "# generated from manifests external_dependencies"
- repo: https://github.com/PyCQA/flake8
rev: 3.9.2
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.1.3
hooks:
- id: flake8
name: flake8
additional_dependencies: ["flake8-bugbear==21.9.2"]
- id: ruff
args: [--fix, --exit-non-zero-on-fix]
- id: ruff-format
- repo: https://github.com/OCA/pylint-odoo
rev: v9.0.4
hooks:
Expand Down
2 changes: 1 addition & 1 deletion .pylintrc
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ readme-template-url="https://github.com/OCA/maintainer-tools/blob/master/templat
manifest-required-authors=OpenG2P
manifest-required-keys=license
manifest-deprecated-keys=description,active
license-allowed=AGPL-3,GPL-2,GPL-2 or any later version,GPL-3,GPL-3 or any later version,LGPL-3
license-allowed=AGPL-3,GPL-2,GPL-2 or any later version,GPL-3,GPL-3 or any later version,LGPL-3,Other OSI approved licence
valid-odoo-versions=17.0

[MESSAGES CONTROL]
Expand Down
2 changes: 1 addition & 1 deletion .pylintrc-mandatory
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ readme-template-url="https://github.com/OCA/maintainer-tools/blob/master/templat
manifest-required-authors=OpenG2P
manifest-required-keys=license
manifest-deprecated-keys=description,active
license-allowed=AGPL-3,GPL-2,GPL-2 or any later version,GPL-3,GPL-3 or any later version,LGPL-3
license-allowed=AGPL-3,GPL-2,GPL-2 or any later version,GPL-3,GPL-3 or any later version,LGPL-3,Other OSI approved licence
valid-odoo-versions=17.0

[MESSAGES CONTROL]
Expand Down
31 changes: 31 additions & 0 deletions .ruff.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@

target-version = "py310"
fix = true
line-length = 110

[lint]
extend-select = [
"B",
"C90",
"E501", # line too long (default 88)
"I", # isort
"UP", # pyupgrade
]
exclude = ["setup/*"]

[format]
exclude = ["setup/*"]

[per-file-ignores]
"__init__.py" = ["F401", "I001"] # ignore unused and unsorted imports in __init__.py
"__manifest__.py" = ["B018"] # useless expression

[isort]
section-order = ["future", "standard-library", "third-party", "odoo", "odoo-addons", "first-party", "local-folder"]

[isort.sections]
"odoo" = ["odoo"]
"odoo-addons" = ["odoo.addons"]

[mccabe]
max-complexity = 16
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@

<!-- /!\ Non OCA Context : Set here the badge of your runbot / runboat instance. -->
[![Pre-commit Status](https://github.com/OpenG2P/openg2p-self-service-portal/actions/workflows/pre-commit.yml/badge.svg?branch=17.0)](https://github.com/OpenG2P/openg2p-self-service-portal/actions/workflows/pre-commit.yml?query=branch%3A17.0)
[![Build Status](https://github.com/OpenG2P/openg2p-self-service-portal/actions/workflows/test.yml/badge.svg?branch=17.0)](https://github.com/OpenG2P/openg2p-self-service-portal/actions/workflows/test.yml?query=branch%3A17.0)
[![codecov](https://codecov.io/gh/OpenG2P/openg2p-self-service-portal/branch/17.0/graph/badge.svg)](https://codecov.io/gh/OpenG2P/openg2p-self-service-portal)
[![Pre-commit Status](https://github.com/OpenG2P/openg2p-self-service-portal/actions/workflows/pre-commit.yml/badge.svg?branch=17.0-develop)](https://github.com/OpenG2P/openg2p-self-service-portal/actions/workflows/pre-commit.yml?query=branch%3A17.0-develop)
[![Build Status](https://github.com/OpenG2P/openg2p-self-service-portal/actions/workflows/test.yml/badge.svg?branch=17.0-develop)](https://github.com/OpenG2P/openg2p-self-service-portal/actions/workflows/test.yml?query=branch%3A17.0-develop)
[![codecov](https://codecov.io/gh/OpenG2P/openg2p-self-service-portal/branch/17.0-develop/graph/badge.svg)](https://codecov.io/gh/OpenG2P/openg2p-self-service-portal)
<!-- /!\ Non OCA Context : Set here the badge of your translation instance. -->

<!-- /!\ do not modify above this line -->

# OpenG2P Self Service Portal

Beneficiary facing self service portal. Refer to [OpenG2P Docs](https://docs.openg2p.org/v/1.1).
Beneficiary facing self service portal. Refer to [OpenG2P Docs](https://docs.openg2p.org).

<!-- /!\ do not modify below this line -->

Expand All @@ -21,8 +21,8 @@ Available addons
----------------
addon | version | maintainers | summary
--- | --- | --- | ---
[g2p_self_service_portal](g2p_self_service_portal/) | 17.0.1.0.0 | | G2P Self Service Portal
[g2p_service_provider_portal](g2p_service_provider_portal/) | 17.0.1.0.0 | | G2P Service Provider Portal
[g2p_self_service_portal](g2p_self_service_portal/) | 17.0.1.2.0 | | G2P Self Service Portal
[g2p_service_provider_portal](g2p_service_provider_portal/) | 17.0.1.2.0 | | G2P Service Provider Portal

[//]: # (end addons)

Expand Down
6 changes: 3 additions & 3 deletions g2p_self_service_portal/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ G2P Self Service Portal
:target: https://odoo-community.org/page/development-status
:alt: Alpha
.. |badge2| image:: https://img.shields.io/badge/github-OpenG2P%2Fopeng2p--self--service--portal-lightgray.png?logo=github
:target: https://github.com/OpenG2P/openg2p-self-service-portal/tree/17.0/g2p_self_service_portal
:target: https://github.com/OpenG2P/openg2p-self-service-portal/tree/17.0-develop/g2p_self_service_portal
:alt: OpenG2P/openg2p-self-service-portal

|badge1| |badge2|
Expand All @@ -37,7 +37,7 @@ Bug Tracker
Bugs are tracked on `GitHub Issues <https://github.com/OpenG2P/openg2p-self-service-portal/issues>`_.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us to smash it by providing a detailed and welcomed
`feedback <https://github.com/OpenG2P/openg2p-self-service-portal/issues/new?body=module:%20g2p_self_service_portal%0Aversion:%2017.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
`feedback <https://github.com/OpenG2P/openg2p-self-service-portal/issues/new?body=module:%20g2p_self_service_portal%0Aversion:%2017.0-develop%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.

Do not contact contributors directly about support or help with technical issues.

Expand All @@ -52,6 +52,6 @@ Authors
Maintainers
~~~~~~~~~~~

This module is part of the `OpenG2P/openg2p-self-service-portal <https://github.com/OpenG2P/openg2p-self-service-portal/tree/17.0/g2p_self_service_portal>`_ project on GitHub.
This module is part of the `OpenG2P/openg2p-self-service-portal <https://github.com/OpenG2P/openg2p-self-service-portal/tree/17.0-develop/g2p_self_service_portal>`_ project on GitHub.

You are welcome to contribute.
Loading

0 comments on commit c8db833

Please sign in to comment.