-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Single threadpool #24
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
# 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" | ||
|
||
on: | ||
push: | ||
branches: [ master ] | ||
pull_request: | ||
# The branches below must be a subset of the branches above | ||
branches: [ master ] | ||
schedule: | ||
- cron: '29 8 * * 4' | ||
|
||
jobs: | ||
analyze: | ||
name: Analyze | ||
runs-on: ubuntu-latest | ||
permissions: | ||
actions: read | ||
contents: read | ||
security-events: write | ||
|
||
strategy: | ||
fail-fast: false | ||
matrix: | ||
language: [ 'python' ] | ||
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ] | ||
# Learn more about CodeQL language support at https://git.io/codeql-language-support | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v2 | ||
|
||
# Initializes the CodeQL tools for scanning. | ||
- name: Initialize CodeQL | ||
uses: github/codeql-action/init@v1 | ||
with: | ||
languages: ${{ matrix.language }} | ||
# 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. | ||
# queries: ./path/to/local/query, your-org/your-repo/queries@main | ||
|
||
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java). | ||
# If this step fails, then you should remove it and run the build manually (see below) | ||
- name: Autobuild | ||
uses: github/codeql-action/autobuild@v1 | ||
|
||
# ℹ️ Command-line programs to run using the OS shell. | ||
# 📚 https://git.io/JvXDl | ||
|
||
# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines | ||
# and modify them (or add more) to build your code if your project | ||
# uses a compiled language | ||
|
||
#- run: | | ||
# make bootstrap | ||
# make release | ||
|
||
- name: Perform CodeQL Analysis | ||
uses: github/codeql-action/analyze@v1 |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,13 +22,4 @@ jobs: | |
run: poetry install -n -v | ||
|
||
- name: Lint with flakeheaven | ||
run: poetry run flakeheaven lint | ||
|
||
- name: Lint with black | ||
run: poetry run black . --check | ||
|
||
- name: Lint with isort | ||
run: poetry run isort . --check | ||
|
||
- name: Lint with mypy | ||
run: poetry run mypy . | ||
run: poetry run pre-commit run --all-files | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, I love pre-commit! |
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
|
||
# Byte-compiled / optimized / DLL files | ||
__pycache__/ | ||
*.py[cod] | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
exclude: "^docs/gitbook/" | ||
repos: | ||
- repo: https://github.com/pre-commit/pre-commit-hooks | ||
rev: v3.3.0 # Use the ref you want to point at | ||
hooks: | ||
- id: trailing-whitespace | ||
- id: check-ast | ||
- id: check-case-conflict | ||
- id: debug-statements | ||
- id: check-yaml | ||
|
||
- repo: https://github.com/pycqa/isort | ||
rev: 5.10.1 | ||
hooks: | ||
- id: isort | ||
name: isort (python) | ||
|
||
- repo: https://github.com/ambv/black | ||
rev: 21.12b0 | ||
hooks: | ||
- id: black | ||
language_version: python3.8 | ||
|
||
- repo: https://github.com/pre-commit/pygrep-hooks | ||
rev: v1.7.0 | ||
hooks: | ||
- id: python-use-type-annotations | ||
- id: python-no-eval | ||
- id: python-no-log-warn | ||
|
||
- repo: local | ||
hooks: | ||
- id: pytest | ||
name: pytest | ||
entry: poetry run pytest tests | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should a failing unit test prevent me from ever committing my code? (I think Pytest has an annotation to allow failures.) Should I have to wait for the unit tests to complete every time I make an incremental commit? (I haven't checked yet to see how long they take now.) I don't mind linters and other static analyzers here in pre-commit, but I would tend to avoid having such a heavyweight check in the pre-commit. What do you think? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think this is a mildly controversial choice but I like it for how it shapes thinking and keeps testing front of mind - the tests/ folder is fast and should always be kept fast or it'd be a regression/bad change in general. We can use a differnent test dir for slower/integ tests Pros are that as a tool that we don't really want to break the API contract established on, encouraging tests to be kept up to date per commit and small units of change is a positive. Additional features shouldn't be too burdonsome to add tests alongside at commit time, and failing commits can still be pushed with --no-verify for WIP changes on branches. That said, it's super annoying for this kind of PR and any other big code arch changes. Hopefully this will tbe be the last of those! If there's feedback it's a net negative I'm open to dropping it. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Okay, let's try it! |
||
language: system | ||
pass_filenames: false | ||
# alternatively you could `types: [python]` so it only runs when python files change | ||
# though tests might be invalidated if you were to say change a data file | ||
always_run: true | ||
|
||
- id: flakeheaven | ||
name: flakeheaven | ||
entry: poetry run flakeheaven lint | ||
language: system | ||
pass_filenames: false | ||
|
||
- id: mypy | ||
name: mypy | ||
entry: poetry run mypy . | ||
language: system | ||
pass_filenames: false | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't know about CodeQL! Looks like SonarQube or Semgrep.
In this PR I don't see any config for the rules it would use (I don't know what they would look like.) Is it using a default rule set?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's a bit weird and magical, I just hit the "add codeQL" button and it gave me some yaml for an action :D I don't get much chance to use Github these days so thought it couldn't hurt to stick this in to try. It's using whatever it's default rules are, but I did have to squash a bunch of false positives in the action itself so it's storing state somewhere too.
I can't say I'm super impressed so far, but SAST tools always feel a bit awkward - I dropped Bandit in this PR too as it irritated me enough