Skip to content

Commit

Permalink
manual sync with cookiecutter (#42)
Browse files Browse the repository at this point in the history
  • Loading branch information
gsnider2195 authored Sep 3, 2024
1 parent ec80893 commit 26d2d99
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 38 deletions.
2 changes: 1 addition & 1 deletion .cookiecutter.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"cookiecutter": {
"codeowner_github_usernames": "@cmsirbu @snaselj @whitej6",
"codeowner_github_usernames": "@nautobot/maintain-nautobot-apps",
"full_name": "Network to Code, LLC",
"email": "[email protected]",
"github_org": "nautobot",
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,6 @@ jobs:
if: "matrix.db-backend == 'mysql'"
- name: "Run Tests"
run: "poetry run invoke unittest"

changelog:
if: >
contains(fromJson('["develop","ltm-1.6"]'), github.base_ref) &&
Expand Down
3 changes: 1 addition & 2 deletions development/nautobot_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,7 @@
"PASSWORD": os.getenv("NAUTOBOT_DB_PASSWORD", ""), # Database password
"HOST": os.getenv("NAUTOBOT_DB_HOST", "localhost"), # Database server
"PORT": os.getenv(
"NAUTOBOT_DB_PORT",
default_db_settings[nautobot_db_engine]["NAUTOBOT_DB_PORT"],
"NAUTOBOT_DB_PORT", default_db_settings[nautobot_db_engine]["NAUTOBOT_DB_PORT"]
), # Database port, default to postgres
"CONN_MAX_AGE": int(os.getenv("NAUTOBOT_DB_TIMEOUT", "300")), # Database timeout
"ENGINE": nautobot_db_engine,
Expand Down
7 changes: 1 addition & 6 deletions nautobot_dev_example/forms.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,7 @@
"""Forms for nautobot_dev_example."""

from django import forms
from nautobot.apps.forms import (
NautobotBulkEditForm,
NautobotFilterForm,
NautobotModelForm,
TagsBulkEditFormMixin,
)
from nautobot.apps.forms import NautobotBulkEditForm, NautobotFilterForm, NautobotModelForm, TagsBulkEditFormMixin

from nautobot_dev_example import models

Expand Down
2 changes: 1 addition & 1 deletion nautobot_dev_example/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
# Nautobot imports
from nautobot.apps.models import PrimaryModel

# from nautobot.extras.utils import extras_features
# from nautobot.apps.models import extras_features
# If you want to use the extras_features decorator please reference the following documentation
# https://docs.nautobot.com/projects/core/en/latest/plugins/development/#using-the-extras_features-decorator-for-graphql
# Then based on your reading you may decide to put the following decorator before the declaration of your class
Expand Down
20 changes: 10 additions & 10 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -64,12 +64,12 @@ all = [

[tool.pylint.master]
# Include the pylint_django plugin to avoid spurious warnings about Django patterns
load-plugins="pylint_django, pylint_nautobot"
ignore=".venv"
load-plugins = "pylint_django, pylint_nautobot"
ignore = ".venv"

[tool.pylint.basic]
# No docstrings required for private methods (Pylint default), or for test_ functions, or for inner Meta classes.
no-docstring-rgx="^(_|test_|Meta$)"
no-docstring-rgx = "^(_|test_|Meta$)"

[tool.pylint.messages_control]
disable = """,
Expand Down Expand Up @@ -101,21 +101,21 @@ select = [
]
ignore = [
# warning: `one-blank-line-before-class` (D203) and `no-blank-line-before-class` (D211) are incompatible.
"D203", # 1 blank line required before class docstring
"D203", # 1 blank line required before class docstring

# D212 is enabled by default in google convention, and complains if we have a docstring like:
# """
# My docstring is on the line after the opening quotes instead of on the same line as them.
# """
# We've discussed and concluded that we consider this to be a valid style choice.
"D212", # Multi-line docstring summary should start at the first line
"D213", # Multi-line docstring summary should start at the second line
"D212", # Multi-line docstring summary should start at the first line
"D213", # Multi-line docstring summary should start at the second line

# Produces a lot of issues in the current codebase.
"D401", # First line of docstring should be in imperative mood
"D407", # Missing dashed underline after section
"D416", # Section name ends in colon
"E501", # Line too long
"D401", # First line of docstring should be in imperative mood
"D407", # Missing dashed underline after section
"D416", # Section name ends in colon
"E501", # Line too long
]

[tool.ruff.lint.pydocstyle]
Expand Down
20 changes: 3 additions & 17 deletions tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -530,12 +530,7 @@ def dbshell(context, db_name="", input_file="", output_file="", query=""):
f"> '{output_file}'" if output_file else "",
]

docker_compose(
context,
" ".join(command),
env=env,
pty=not (input_file or output_file or query),
)
docker_compose(context, " ".join(command), env=env, pty=not (input_file or output_file or query))


@task(
Expand Down Expand Up @@ -856,20 +851,11 @@ def generate_app_config_schema(context):
- `NautobotAppConfig.required_settings`
"""
start(context, service="nautobot")
nbshell(
context,
file="development/app_config_schema.py",
env={"APP_CONFIG_SCHEMA_COMMAND": "generate"},
)
nbshell(context, file="development/app_config_schema.py", env={"APP_CONFIG_SCHEMA_COMMAND": "generate"})


@task
def validate_app_config(context):
"""Validate the app config based on the app config schema."""
start(context, service="nautobot")
nbshell(
context,
plain=True,
file="development/app_config_schema.py",
env={"APP_CONFIG_SCHEMA_COMMAND": "validate"},
)
nbshell(context, plain=True, file="development/app_config_schema.py", env={"APP_CONFIG_SCHEMA_COMMAND": "validate"})

0 comments on commit 26d2d99

Please sign in to comment.