diff --git a/.ruff.toml b/.ruff.toml new file mode 100644 index 0000000..52e586d --- /dev/null +++ b/.ruff.toml @@ -0,0 +1,58 @@ +# Exclude a variety of commonly ignored directories. +exclude = [ + ".bzr", + ".direnv", + ".eggs", + ".git", + ".git-rewrite", + ".hg", + ".ipynb_checkpoints", + ".mypy_cache", + ".nox", + ".pants.d", + ".pyenv", + ".pytest_cache", + ".pytype", + ".ruff_cache", + ".svn", + ".tox", + ".venv", + ".vscode", + "__pypackages__", + "_build", + "buck-out", + "build", + "dist", + "node_modules", + "site-packages", + "venv", +] + +# Same as Black. +line-length = 88 +indent-width = 4 + +# Assume Python 3.8 +target-version = "py38" + +[lint] +# Enable Pyflakes (`F`) and a subset of the pycodestyle (`E`) codes by default. +# Unlike Flake8, Ruff doesn't enable pycodestyle warnings (`W`) or +# McCabe complexity (`C901`) by default. +select = ["E", "F", "I"] +ignore = [] +fixable = ["ALL"] +unfixable = [] +dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$" + +[lint.per-file-ignores] +"__init__.py" = ["E402", "F401"] # unused imports, and top level imports +"sls/alembic/versions/*" = ["E501"] # ignore long lines for migrations + +[format] +quote-style = "double" +indent-style = "space" +skip-magic-trailing-comma = false +line-ending = "auto" +docstring-code-format = true +docstring-code-line-length = "dynamic" diff --git a/package_managers/homebrew/jq/dependencies.jq b/package_managers/homebrew/jq/dependencies.jq index 57cd322..8127db8 100644 --- a/package_managers/homebrew/jq/dependencies.jq +++ b/package_managers/homebrew/jq/dependencies.jq @@ -22,7 +22,7 @@ select(.depends_on | type == "string") | # generate the sql statements! "INSERT INTO dependencies (version_id, dependency_id, dependency_type_id) VALUES ( - (SELECT id FROM versions WHERE import_id = '" + .package_name + "'), + (SELECT id FROM versions WHERE import_id = '" + .package_name + "' ORDER BY created_at DESC LIMIT 1), (SELECT id FROM packages WHERE import_id = '" + .depends_on + "'), '" + .depends_on_type + "') ON CONFLICT DO NOTHING;" ] | join("\n") \ No newline at end of file