From 7de4e4273bd2fa6515d1eee3d54f9e974f2394d9 Mon Sep 17 00:00:00 2001 From: Abel Soares Siqueira Date: Tue, 11 Jun 2024 13:52:32 +0200 Subject: [PATCH] Update template change minimum to recommended --- .all-contributorsrc | 5 + .copier-answers.yml | 2 +- .github/ISSUE_TEMPLATE/10-bug-report.yml | 61 ++++++++ .github/ISSUE_TEMPLATE/20-feature-request.yml | 37 +++++ .github/ISSUE_TEMPLATE/30-usage.yml | 24 ++++ .github/ISSUE_TEMPLATE/99-general.yml | 22 +++ .github/ISSUE_TEMPLATE/config.yml | 5 + .github/PULL_REQUEST_TEMPLATE.md | 28 ++++ .github/workflows/Lint.yml | 27 +++- .github/workflows/PreCommitUpdate.yml | 35 +++++ .github/workflows/Test.yml | 13 +- .github/workflows/TestOnPRs.yml | 29 ++++ .pre-commit-config.yaml | 16 +-- CODE_OF_CONDUCT.md | 133 ++++++++++++++++++ README.md | 13 +- docs/src/90-developer.md | 32 ++++- docs/src/index.md | 13 ++ 17 files changed, 467 insertions(+), 28 deletions(-) create mode 100644 .all-contributorsrc create mode 100644 .github/ISSUE_TEMPLATE/10-bug-report.yml create mode 100644 .github/ISSUE_TEMPLATE/20-feature-request.yml create mode 100644 .github/ISSUE_TEMPLATE/30-usage.yml create mode 100644 .github/ISSUE_TEMPLATE/99-general.yml create mode 100644 .github/ISSUE_TEMPLATE/config.yml create mode 100644 .github/PULL_REQUEST_TEMPLATE.md create mode 100644 .github/workflows/PreCommitUpdate.yml create mode 100644 .github/workflows/TestOnPRs.yml create mode 100644 CODE_OF_CONDUCT.md diff --git a/.all-contributorsrc b/.all-contributorsrc new file mode 100644 index 0000000..a30ef57 --- /dev/null +++ b/.all-contributorsrc @@ -0,0 +1,5 @@ +{ + "projectName": "TulipaIO", + "projectOwner": "TulipaEnergy", + "files": ["README.md", "docs/src/index.md"] +} diff --git a/.copier-answers.yml b/.copier-answers.yml index 3ce6a0f..c562cb3 100644 --- a/.copier-answers.yml +++ b/.copier-answers.yml @@ -1,5 +1,5 @@ # Changes here will be overwritten by Copier -AnswerStrategy: minimum +AnswerStrategy: recommended AuthorEmail: fatkasuvayu+linux@gmail.com AuthorName: Suvayu Ali Indentation: 4 diff --git a/.github/ISSUE_TEMPLATE/10-bug-report.yml b/.github/ISSUE_TEMPLATE/10-bug-report.yml new file mode 100644 index 0000000..ff24f95 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/10-bug-report.yml @@ -0,0 +1,61 @@ +name: Bug Report +description: File a bug report related to running the package +title: "[Bug] " +labels: ["bug"] +body: + - type: markdown + attributes: + value: | + Thanks for taking the time to fill out this bug report! + + Please, before submitting, make sure that: + + - There is not an [existing issue](https://github.com/TulipaEnergy/TulipaIO.jl/issues) with the same question + - You have read the [contributing guide](https://github.com/TulipaEnergy/TulipaIO.jl/blob/main/docs/src/90-contributing.md/) + - You are following the [code of conduct](https://github.com/TulipaEnergy/TulipaIO.jl/blob/main/CODE_OF_CONDUCT.md) + + The form below should help you in filling out this issue. + - type: textarea + id: description + attributes: + label: Description + description: Describe the bug + validations: + required: true + - type: input + id: pkg-version + attributes: + label: Package Version + description: What version of the package are you running? + validations: + required: true + - type: input + id: version + attributes: + label: Julia Version + description: What version of Julia are you running? + validations: + required: true + - type: textarea + id: reproduction + attributes: + label: Reproduction steps + description: What steps led to the bug happening? + validations: + required: true + - type: textarea + id: logs + attributes: + label: Relevant log output + description: Please copy and paste any relevant log output. This will be automatically formatted into code, so no need for backticks. + render: shell + - type: dropdown + id: os + attributes: + label: "Operating System" + description: What is the impacted environment? + multiple: true + options: + - Windows + - Linux + - Mac diff --git a/.github/ISSUE_TEMPLATE/20-feature-request.yml b/.github/ISSUE_TEMPLATE/20-feature-request.yml new file mode 100644 index 0000000..1669802 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/20-feature-request.yml @@ -0,0 +1,37 @@ +name: "Feature Request" +description: Suggest a new feature for the package +body: + - type: markdown + attributes: + value: | + Thanks for taking the time to fill out this bug report! + + Please, before submitting, make sure that: + + - There is not an [existing issue](https://github.com/TulipaEnergy/TulipaIO.jl/issues) with the same question + - You have read the [contributing guide](https://github.com/TulipaEnergy/TulipaIO.jl/blob/main/docs/src/90-contributing.md/) + - You are following the [code of conduct](https://github.com/TulipaEnergy/TulipaIO.jl/blob/main/CODE_OF_CONDUCT.md) + + The form below should help you in filling out this issue. + - type: textarea + id: description + attributes: + label: Description + description: Describe the requested feature + validations: + required: true + - type: textarea + id: motivation + attributes: + label: Motivation + description: Explain why this feature is relevant + - type: textarea + id: target + attributes: + label: Target audience + description: Tell more about the users of this feature, or where it could be useful + - type: textarea + id: can-help + attributes: + label: Can you help + description: Can you help developing this feature? diff --git a/.github/ISSUE_TEMPLATE/30-usage.yml b/.github/ISSUE_TEMPLATE/30-usage.yml new file mode 100644 index 0000000..098c400 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/30-usage.yml @@ -0,0 +1,24 @@ +name: "Usage question" +description: Questions related to the usage +labels: ["documentation"] +body: + - type: markdown + attributes: + value: | + Thanks for taking the time to fill out this bug report! + + Please, before submitting, make sure that: + + - You have checked the [documentation](https://TulipaEnergy.github.io/TulipaIO.jl) and haven't found enough information + - There is not an [existing issue](https://github.com/TulipaEnergy/TulipaIO.jl/issues) with the same question + - You have read the [contributing guide](https://github.com/TulipaEnergy/TulipaIO.jl/blob/main/docs/src/90-contributing.md/) + - You are following the [code of conduct](https://github.com/TulipaEnergy/TulipaIO.jl/blob/main/CODE_OF_CONDUCT.md) + + The form below should help you in filling out this issue. + - type: textarea + id: description + attributes: + label: Description + description: Write your question + validations: + required: true diff --git a/.github/ISSUE_TEMPLATE/99-general.yml b/.github/ISSUE_TEMPLATE/99-general.yml new file mode 100644 index 0000000..a6dde60 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/99-general.yml @@ -0,0 +1,22 @@ +name: "General issue" +description: In case none of the others templates apply +body: + - type: markdown + attributes: + value: | + Thanks for taking the time to fill out this bug report! + + Please, before submitting, make sure that: + + - There is not an [existing issue](https://github.com/TulipaEnergy/TulipaIO.jl/issues) with the same question + - You have read the [contributing guide](https://github.com/TulipaEnergy/TulipaIO.jl/blob/main/docs/src/90-contributing.md/) + - You are following the [code of conduct](https://github.com/TulipaEnergy/TulipaIO.jl/blob/main/CODE_OF_CONDUCT.md) + + The form below should help you in filling out this issue. + - type: textarea + id: description + attributes: + label: Description + description: Describe the issue + validations: + required: true diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml new file mode 100644 index 0000000..433a0e4 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -0,0 +1,5 @@ +blank_issues_enabled: false +contact_links: + - name: Discussions + url: https://github.com/TulipaEnergy/TulipaIO.jl/discussions + about: Create and follow discussions here diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000..42a0487 --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,28 @@ + + +## Related issues + + + + +Closes # + + + + +## Checklist + + + +- [ ] I am following the [contributing guidelines](https://github.com/TulipaEnergy/TulipaIO.jl/blob/main/docs/src/90-contributing.md) +- [ ] Tests are passing +- [ ] Lint workflow is passing +- [ ] Docs were updated and workflow is passing + diff --git a/.github/workflows/Lint.yml b/.github/workflows/Lint.yml index f6c7c14..b240586 100644 --- a/.github/workflows/Lint.yml +++ b/.github/workflows/Lint.yml @@ -19,18 +19,37 @@ jobs: runs-on: ubuntu-latest steps: - name: Clone - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Setup Julia - uses: julia-actions/setup-julia@v1 + uses: julia-actions/setup-julia@v2 with: version: "1" - name: Use Julia cache - uses: julia-actions/cache@v1 + uses: julia-actions/cache@v2 - name: Install JuliaFormatter.jl run: julia -e 'using Pkg; pkg"add JuliaFormatter"' - name: Setup Python - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 + with: + cache: "pip" + - name: Cache pre-commit + uses: actions/cache@v4 + with: + path: ~/.cache/pre-commit + key: ${{ runner.os }}-pre-commit-${{ hashFiles('**/.pre-commit-config.yaml') }} - name: Install pre-commit run: pip install pre-commit - name: Run pre-commit run: SKIP=no-commit-to-branch pre-commit run -a + + link-checker: + name: Link checker + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Link Checker + id: lychee + uses: lycheeverse/lychee-action@v1 + with: + fail: true diff --git a/.github/workflows/PreCommitUpdate.yml b/.github/workflows/PreCommitUpdate.yml new file mode 100644 index 0000000..587c090 --- /dev/null +++ b/.github/workflows/PreCommitUpdate.yml @@ -0,0 +1,35 @@ +name: pre-commit Update + +on: + schedule: + - cron: "0 7 1/7 * *" # At 7:00 every 7 days + workflow_dispatch: + +jobs: + pre-commit-update: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Setup Python + uses: actions/setup-python@v5 + with: + cache: pip + - name: Install pre-commit + run: pip install pre-commit + - name: Run pre-commit's autoupdate + run: | + # ignore exit code + pre-commit autoupdate || true + - name: Create Pull Request + id: cpr + uses: peter-evans/create-pull-request@v6 + with: + commit-message: "chore: :robot: pre-commit update" + title: "[AUTO] pre-commit update" + branch: auto-pre-commit-update + delete-branch: true + labels: chore + - name: Check outputs + run: | + echo "Pull Request Number - ${{ steps.cpr.outputs.pull-request-number }}" + echo "Pull Request URL - ${{ steps.cpr.outputs.pull-request-url }}" diff --git a/.github/workflows/Test.yml b/.github/workflows/Test.yml index 5f98c69..3fa79d3 100644 --- a/.github/workflows/Test.yml +++ b/.github/workflows/Test.yml @@ -5,14 +5,7 @@ on: branches: - main tags: ["*"] - pull_request: - branches: - - main - paths: - - "src/**" - - "test/**" - - "*.toml" - types: [opened, synchronize, reopened] + workflow_dispatch: jobs: @@ -34,8 +27,8 @@ jobs: - "1" os: - ubuntu-latest - #- macOS-latest - #- windows-latest + - macOS-latest + - windows-latest arch: - x64 allow_failure: [false] diff --git a/.github/workflows/TestOnPRs.yml b/.github/workflows/TestOnPRs.yml new file mode 100644 index 0000000..db46eef --- /dev/null +++ b/.github/workflows/TestOnPRs.yml @@ -0,0 +1,29 @@ +name: Test on PRs + +on: + pull_request: + branches: + - main + paths: + - "src/**" + - "test/**" + - "*.toml" + types: [opened, synchronize, reopened] + +concurrency: + # Skip intermediate builds: always. + # Cancel intermediate builds: only if it is a pull request build. + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }} + +jobs: + test: + uses: ./.github/workflows/ReusableTest.yml + with: + os: ubuntu-latest + version: "1" + arch: x64 + allow_failure: false + run_codecov: true + secrets: + codecov_token: ${{ secrets.CODECOV_TOKEN }} diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 03eed8a..f796296 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -8,7 +8,7 @@ repos: language: fail files: "\\.rej$" - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.4.0 + rev: v4.6.0 hooks: - id: check-json - id: check-toml @@ -26,7 +26,7 @@ repos: - id: check-merge-conflict args: [--assume-in-merge] - repo: https://github.com/igorshubovych/markdownlint-cli - rev: v0.37.0 + rev: v0.41.0 hooks: - id: markdownlint-fix - repo: https://github.com/citation-file-format/cffconvert @@ -34,22 +34,16 @@ repos: hooks: - id: validate-cff - repo: https://github.com/pre-commit/mirrors-prettier - rev: "v3.0.3" # Use the sha or tag you want to point at + rev: "v4.0.0-alpha.8" # Use the sha or tag you want to point at hooks: - id: prettier types_or: [yaml, json] exclude: ".copier-answers.yml" - repo: https://github.com/adrienverge/yamllint - rev: v1.32.0 + rev: v1.35.1 hooks: - id: yamllint - repo: https://github.com/domluna/JuliaFormatter.jl - rev: v1.0.36 + rev: v1.0.56 hooks: - id: julia-formatter - - repo: https://github.com/tcort/markdown-link-check - rev: v3.11.2 - hooks: - - id: markdown-link-check - args: - - --config=.markdown-link-config.json diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md new file mode 100644 index 0000000..6221fdd --- /dev/null +++ b/CODE_OF_CONDUCT.md @@ -0,0 +1,133 @@ + +# Contributor Covenant Code of Conduct + +## Our Pledge + +We as members, contributors, and leaders pledge to make participation in our +community a harassment-free experience for everyone, regardless of age, body +size, visible or invisible disability, ethnicity, sex characteristics, gender +identity and expression, level of experience, education, socio-economic status, +nationality, personal appearance, race, caste, color, religion, or sexual +identity and orientation. + +We pledge to act and interact in ways that contribute to an open, welcoming, +diverse, inclusive, and healthy community. + +## Our Standards + +Examples of behavior that contributes to a positive environment for our +community include: + +* Demonstrating empathy and kindness toward other people +* Being respectful of differing opinions, viewpoints, and experiences +* Giving and gracefully accepting constructive feedback +* Accepting responsibility and apologizing to those affected by our mistakes, + and learning from the experience +* Focusing on what is best not just for us as individuals, but for the overall + community + +Examples of unacceptable behavior include: + +* The use of sexualized language or imagery, and sexual attention or advances of + any kind +* Trolling, insulting or derogatory comments, and personal or political attacks +* Public or private harassment +* Publishing others' private information, such as a physical or email address, + without their explicit permission +* Other conduct which could reasonably be considered inappropriate in a + professional setting + +## Enforcement Responsibilities + +Community leaders are responsible for clarifying and enforcing our standards of +acceptable behavior and will take appropriate and fair corrective action in +response to any behavior that they deem inappropriate, threatening, offensive, +or harmful. + +Community leaders have the right and responsibility to remove, edit, or reject +comments, commits, code, wiki edits, issues, and other contributions that are +not aligned to this Code of Conduct, and will communicate reasons for moderation +decisions when appropriate. + +## Scope + +This Code of Conduct applies within all community spaces, and also applies when +an individual is officially representing the community in public spaces. +Examples of representing our community include using an official email address, +posting via an official social media account, or acting as an appointed +representative at an online or offline event. + +## Enforcement + +Instances of abusive, harassing, or otherwise unacceptable behavior may be +reported to the community leaders responsible for enforcement at +`fatkasuvayu+linux@gmail.com`. +All complaints will be reviewed and investigated promptly and fairly. + +All community leaders are obligated to respect the privacy and security of the +reporter of any incident. + +## Enforcement Guidelines + +Community leaders will follow these Community Impact Guidelines in determining +the consequences for any action they deem in violation of this Code of Conduct: + +### 1. Correction + +**Community Impact**: Use of inappropriate language or other behavior deemed +unprofessional or unwelcome in the community. + +**Consequence**: A private, written warning from community leaders, providing +clarity around the nature of the violation and an explanation of why the +behavior was inappropriate. A public apology may be requested. + +### 2. Warning + +**Community Impact**: A violation through a single incident or series of +actions. + +**Consequence**: A warning with consequences for continued behavior. No +interaction with the people involved, including unsolicited interaction with +those enforcing the Code of Conduct, for a specified period of time. This +includes avoiding interactions in community spaces as well as external channels +like social media. Violating these terms may lead to a temporary or permanent +ban. + +### 3. Temporary Ban + +**Community Impact**: A serious violation of community standards, including +sustained inappropriate behavior. + +**Consequence**: A temporary ban from any sort of interaction or public +communication with the community for a specified period of time. No public or +private interaction with the people involved, including unsolicited interaction +with those enforcing the Code of Conduct, is allowed during this period. +Violating these terms may lead to a permanent ban. + +### 4. Permanent Ban + +**Community Impact**: Demonstrating a pattern of violation of community +standards, including sustained inappropriate behavior, harassment of an +individual, or aggression toward or disparagement of classes of individuals. + +**Consequence**: A permanent ban from any sort of public interaction within the +community. + +## Attribution + +This Code of Conduct is adapted from the [Contributor Covenant][homepage], +version 2.1, available at +[https://www.contributor-covenant.org/version/2/1/code_of_conduct.html][v2.1]. + +Community Impact Guidelines were inspired by +[Mozilla's code of conduct enforcement ladder][Mozilla CoC]. + +For answers to common questions about this code of conduct, see the FAQ at +[https://www.contributor-covenant.org/faq][FAQ]. Translations are available at +[https://www.contributor-covenant.org/translations][translations]. + +[homepage]: https://www.contributor-covenant.org +[v2.1]: https://www.contributor-covenant.org/version/2/1/code_of_conduct.html +[Mozilla CoC]: https://github.com/mozilla/diversity +[FAQ]: https://www.contributor-covenant.org/faq +[translations]: https://www.contributor-covenant.org/translations diff --git a/README.md b/README.md index 776f635..520ff0f 100644 --- a/README.md +++ b/README.md @@ -11,6 +11,8 @@ [![Coverage](https://codecov.io/gh/TulipaEnergy/TulipaIO.jl/branch/main/graph/badge.svg)](https://codecov.io/gh/TulipaEnergy/TulipaIO.jl) [![DOI](https://zenodo.org/badge/DOI/FIXME)](https://doi.org/FIXME) +[![Contributor Covenant](https://img.shields.io/badge/Contributor%20Covenant-2.1-4baaaa.svg)](CODE_OF_CONDUCT.md) +[![All Contributors](https://img.shields.io/github/all-contributors/TulipaEnergy/TulipaIO.jl?labelColor=5e1ec7&color=c0ffee&style=flat-square))](#contributors) ## About `TulipaIO.jl` (`TIO`) @@ -41,4 +43,13 @@ Furthermore, you can read specific information for this package at the [TulipaIO --- -This repo was created with the [COPIERTemplate.jl](https://github.com/abelsiqueira/COPIERTemplate.jl) package. +### Contributors + + + + + + + + + diff --git a/docs/src/90-developer.md b/docs/src/90-developer.md index e8ae341..30e983f 100644 --- a/docs/src/90-developer.md +++ b/docs/src/90-developer.md @@ -28,6 +28,36 @@ You will create branches and push to `origin`, and you will fetch and update you Install a plugin on your editor to use [EditorConfig](https://editorconfig.org). This will ensure that your editor is configured with important formatting settings. +We use [https://pre-commit.com](https://pre-commit.com) to run the linters and formatters. +In particular, the Julia code is formatted using [JuliaFormatter.jl](https://github.com/domluna/JuliaFormatter.jl), so please install it globally first: + +```julia-repl +julia> # Press ] +pkg> activate +pkg> add JuliaFormatter +``` + +To install `pre-commit`, we recommend using [pipx](https://pipx.pypa.io) as follows: + +```bash +# Install pipx following the link +pipx install pre-commit +``` + +With `pre-commit` installed, activate it as a pre-commit hook: + +```bash +pre-commit install +``` + +To run the linting and formatting manually, enter the command below: + +```bash +pre-commit run -a +``` + +**Now, you can only commit if all the pre-commit tests pass**. + ## Testing As with most Julia packages, you can just open Julia in the repository folder, activate the environment, and run `test`: @@ -84,7 +114,7 @@ We try to keep a linear history in this repo, so it is important to keep your br Try to create "atomic git commits" (recommended reading: [The Utopic Git History](https://blog.esciencecenter.nl/the-utopic-git-history-d44b81c09593)). - Make sure the tests pass. - +- Make sure the pre-commit tests pass. - Fetch any `main` updates from upstream and rebase your branch, if necessary: ```bash diff --git a/docs/src/index.md b/docs/src/index.md index 99c2d09..bce5bfc 100644 --- a/docs/src/index.md +++ b/docs/src/index.md @@ -37,3 +37,16 @@ This allows simple conversion to DataFrame as well: using DataFrames: DataFrame DataFrame(DBInterface.execute(con, "SELECT name, type, investable, variable_cost FROM $table_name WHERE name LIKE 'Asgard_%'")) ``` + +## Contributors + +```@raw html + + + + + + + + +```