diff --git a/ .pre-commit-config.yaml b/ .pre-commit-config.yaml deleted file mode 100644 index 4cb676f..0000000 --- a/ .pre-commit-config.yaml +++ /dev/null @@ -1,9 +0,0 @@ -repos: - - repo: https://github.com/psf/black - rev: 21.9b0 - hooks: - - id: black - - repo: https://gitlab.com/pycqa/flake8 - rev: 3.9.2 - hooks: - - id: flake8 diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index f4d4717..c3ec432 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -11,7 +11,7 @@ Refer to the [Contribution Guidelines](CONTRIBUTING.md) for more details. - [ ] `poetry run pytest` passes locally with my changes - [ ] Tests have been added or updated to cover the changes - [ ] Documentation has been updated as needed -- [ ] Code style checks pass (`poetry run flake8` and `poetry run black --check .`) +- [ ] Code style checks pass - [ ] Commit messages follow the [Conventional Commits](https://www.conventionalcommits.org/) guidelines ## Affected Components diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e4d5007..7fe4a47 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,4 +1,3 @@ -# .github/workflows/ci.yml name: CI on: @@ -9,35 +8,28 @@ on: jobs: build: - + name: Build and Test runs-on: ubuntu-latest strategy: matrix: - python-version: [3.12] + python-version: [ 3.12 ] steps: - - uses: actions/checkout@v4 + - name: Checkout code + uses: actions/checkout@v4 - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} - - - name: Install Poetry - run: | - curl -sSL https://install.python-poetry.org | python3 - - export PATH="$HOME/.local/bin:$PATH" + - uses: Gr1N/setup-poetry@v9 - name: Install dependencies - run: | - poetry install --no-interaction --no-ansi + run: poetry install - - name: Run linters - run: | - poetry run flake8 concord/ - poetry run black --check concord/ + - name: Run pre-commit hooks + run: poetry run pre-commit run --all-files --show-diff-on-failure - name: Run tests - run: | - poetry run pytest --cov=concord tests/ + run: poetry run pytest diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index a5efff0..92295d5 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -1,84 +1,59 @@ -# For most projects, this workflow file will not need changing; you simply need -# to commit it to your repository. -# -# You may wish to alter this file to override the set of languages analyzed, -# or to provide custom queries or build logic. -# -# ******** NOTE ******** -# We have attempted to detect the languages in your repository. Please check -# the `language` matrix defined below to confirm you have the correct set of -# supported CodeQL languages. -# -name: "CodeQL Advanced" +name: "CodeQL" on: push: - branches: [ "main" ] + branches: [ main ] pull_request: - branches: [ "main" ] + branches: [ main ] schedule: - - cron: '33 8 * * 2' + - cron: '35 6 * * 3' # Runs at 06:35 every Wednesday jobs: analyze: - name: Analyze (${{ matrix.language }}) - # Runner size impacts CodeQL analysis time. To learn more, please see: - # - https://gh.io/recommended-hardware-resources-for-running-codeql - # - https://gh.io/supported-runners-and-hardware-resources - # - https://gh.io/using-larger-runners (GitHub.com only) - # Consider using larger runners or machines with greater resources for possible analysis time improvements. - runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-latest' }} - permissions: - # required for all workflows - security-events: write - - # required to fetch internal or private CodeQL packs - packages: read + name: Analyze + runs-on: ubuntu-latest - # only required for workflows in private repositories + permissions: actions: read contents: read + security-events: write strategy: fail-fast: false matrix: - include: - # CodeQL supports the following values keywords for 'language': 'c-cpp', 'csharp', 'go', 'java-kotlin', 'javascript-typescript', 'python', 'ruby', 'swift' - # Use `c-cpp` to analyze code written in C, C++ or both - # Use 'java-kotlin' to analyze code written in Java, Kotlin or both - # Use 'javascript-typescript' to analyze code written in JavaScript, TypeScript or both - # To learn more about changing the languages that are analyzed or customizing the build mode for your analysis, - # see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/customizing-your-advanced-setup-for-code-scanning. - # If you are analyzing a compiled language, you can modify the 'build-mode' for that language to customize how - # your codebase is analyzed, see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/codeql-code-scanning-for-compiled-languages - steps: - - name: Checkout repository - uses: actions/checkout@v4 - - # Initializes the CodeQL tools for scanning. - - name: Initialize CodeQL - uses: github/codeql-action/init@v3 - with: - languages: ${{ matrix.language }} - build-mode: ${{ matrix.build-mode }} - # If you wish to specify custom queries, you can do so here or in a config file. - # By default, queries listed here will override any specified in a config file. - # Prefix the list here with "+" to use these queries and those in the config file. + language: [ python ] - # For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs - # queries: security-extended,security-and-quality - - # If the analyze step fails for one of the languages you are analyzing with - # "We were unable to automatically build your code", modify the matrix above - # to set the build mode to "manual" for that language. Then modify this step - # to build your code. - # ℹī¸ Command-line programs to run using the OS shell. - # 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun - - if: matrix.build-mode == 'manual' - shell: bash - run: | - # TODO setup build command - - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v3 - with: - category: "/language:${{matrix.language}}" + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Set up Python 3.12 + uses: actions/setup-python@v5 + with: + python-version: '3.12' + + - name: Install Poetry + run: | + curl -sSL https://install.python-poetry.org | python3 - + export PATH="$HOME/.local/bin:$PATH" + + - name: Cache Poetry Dependencies + uses: actions/cache@v4 + with: + path: | + ~/.cache/pypoetry + **/site-packages + key: ${{ runner.os }}-poetry-${{ hashFiles('**/poetry.lock') }} + + - name: Install Dependencies + run: poetry install --no-root + + - name: Initialize CodeQL + uses: github/codeql-action/init@v3 + with: + languages: ${{ matrix.language }} + # Add any custom queries if needed + # queries: ./path/to/custom/queries + + - name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@v3 diff --git a/.idea/inspectionProfiles/profiles_settings.xml b/.idea/inspectionProfiles/profiles_settings.xml new file mode 100644 index 0000000..105ce2d --- /dev/null +++ b/.idea/inspectionProfiles/profiles_settings.xml @@ -0,0 +1,6 @@ + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 0000000..f8b3cd4 --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,9 @@ + + + + + + \ No newline at end of file diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000..b07f3b8 --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,15 @@ +repos: + - repo: local + hooks: + - id: black + name: black + entry: poetry run black + language: system + types: [ python ] + args: [ --check, --diff ] + - id: flake8 + name: flake8 + entry: poetry run flake8 + language: system + types: [ python ] + diff --git a/concord/main.py b/concord/main.py new file mode 100644 index 0000000..f2f0af7 --- /dev/null +++ b/concord/main.py @@ -0,0 +1,6 @@ +def main(): + return + + +if __name__ == "__main__": + main()