Skip to content
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

feat: Support pyre and basedpyright config #6

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
507 changes: 507 additions & 0 deletions nitpick_styles/generic-basedpyright.toml

Large diffs are not rendered by default.

4 changes: 3 additions & 1 deletion nitpick_styles/generic-flake8.toml
Original file line number Diff line number Diff line change
Expand Up @@ -65,13 +65,15 @@ exclude = """\
# D401: Checks for docstring first lines that are not in an imperative mood.
# X100: ???
# W504: Line break occurred after a binary operator
# E501: Line too long. Should be handled by ruff
ignore = """\
D100,\
D104,\
D106,\
D401,\
X100,\
W504\
W504,\
E501\
"""


Expand Down
2 changes: 0 additions & 2 deletions nitpick_styles/generic-mypy.toml
Original file line number Diff line number Diff line change
Expand Up @@ -41,5 +41,3 @@ enable_error_code = """\
unimported-reveal,\
narrowed-type-not-subtype\
"""

enable_incomplete_feature = "NewGenericSyntax"
1 change: 1 addition & 0 deletions nitpick_styles/generic-pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ dev = [
"typeguard>=4.4.1",

# linter & fomatter
"pylint>=3.3.4",
"import-linter>=2.1",
"isort>=5.13.2",
"ruff>=0.7.3",
Expand Down
33 changes: 33 additions & 0 deletions nitpick_styles/generic-pyre.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
[nitpick.meta]
name = "pyre"
url = "https://github.com/facebook/pyre-check"

[nitpick.files.present]
".pyre_configuration" = "Create the file with the contents below"
".watchmanconfig" = "Create the file with the contents below"

[nitpick.files.tags]
".pyre_configuration" = ["text", "json"]
".watchmanconfig" = ["text"]



# https://pyre-check.org/docs/configuration/
[".pyre_configuration".contains_json]
site_package_search_strategy = """
"all"
"""
source_directories = """
[ "." ]
"""
strict = """
true
"""
python_version = """
"3.12"
"""


# Just an empty json file is enough for pyre
[[".watchmanconfig".contains]]
line = "{}"
57 changes: 43 additions & 14 deletions nitpick_styles/generic-trunk.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,40 +19,69 @@ url = "https://docs.trunk.io/cli/configuration#config-format"
# To learn more about the format of this file, see https://docs.trunk.io/reference/trunk-yaml
version = "0.1"

[".trunk/trunk.yaml".cli]
version = "1.22.9"

# Trunk provides extensibility via plugins. (https://docs.trunk.io/plugins)
[[".trunk/trunk.yaml".plugins.sources]]
id = "trunk"
ref = "v1.6.7"
uri = "https://github.com/trunk-io/plugins"
ref = "main-ng"
uri = "https://github.com/NextGenContributions/plugins"
Comment on lines +26 to +27

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider risks of using forked repository

The PR changes the plugin source from the official Trunk repository (trunk-io/plugins at version v1.6.7) to a fork (NextGenContributions/plugins at branch main-ng). This might introduce compatibility or security issues if the fork is not properly maintained or synchronized with the official repository. Consider whether this change is intentional and necessary.

Code suggestion
Check the AI-generated fix before applying
Suggested change
ref = "main-ng"
uri = "https://github.com/NextGenContributions/plugins"
ref = "v1.6.7"
uri = "https://github.com/trunk-io/plugins"

Code Review Run #288b34


Should Bito avoid suggestions like this for future reviews? (Manage Rules)

  • Yes, avoid them


# Many linters and tools depend on runtimes - configure them here. (https://docs.trunk.io/runtimes)
[".trunk/trunk.yaml".runtimes]
enabled = [
"python@>=3.10.8",
"go@>=1.21.0",
"node@>=18.20.5",
]
[[".trunk/trunk.yaml".runtimes.definitions]]
type = "python"
system_version = "allowed"


# This is the section where you manage your linters. (https://docs.trunk.io/check/configuration)
[".trunk/trunk.yaml".lint]
enabled = [
"actionlint@1.7.7",
"bandit@1.8.2",
"bandit@1.8.3",
"checkov@3.2.382",
"codespell@2.4.1",
# Temporarily disabled until we have better solution for unknown words
# - "cspell@8.17.5",
"djlint@1.36.4",
"flake8",
"git-diff-check",
"markdownlint@0.44.0",
"mypy@1.14.1",
"gitleaks@8.24.0",
"hadolint@2.12.1-beta",
"markdown-link-check@3.13.6",
"markdown-table-prettify@3.6.0",
"markdownlint-cli2@0.17.2",
"mypy",
"osv-scanner@1.9.2",
"prettier@3.4.2",
"pylint@3.3.4",
"renovate@39.141.0",
"ruff@0.9.3",
"prettier@3.5.3",
"pylint",
"pyright",
"basedpyright",
"renovate@39.190.1",
"ruff",
"shellcheck@0.10.0",
"shfmt@3.6.0",
"taplo@0.9.3",
"trufflehog@3.88.3",
"yamllint@1.35.1"
"trivy@0.60.0",
"trufflehog@3.88.15",
"vale@3.9.6",
"yamllint@1.35.1",
]
[[".trunk/trunk.yaml".lint.definitions]]
name = "mypy"
[[".trunk/trunk.yaml".lint.definitions.commands]]
name = "lint"
# Override mypy default command by adding '--no-incremental' flag, which is
# needed to handle "AssertionError: Internal error: method must be called
# on parsed file only" during trunk check run
# Refs:
# - https://github.com/python/mypy/issues/14521
# - https://mypy.readthedocs.io/en/stable/command_line.html#incremental
run = "mypy --no-incremental --ignore-missing-imports --follow-imports=silent --show-error-codes --show-column-numbers ${target}"


[[".trunk/trunk.yaml".lint.ignore]]
linters = ["ALL"]
Expand Down