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

chore: Update pre-commit checks #217

Merged
merged 8 commits into from
Feb 9, 2024

Conversation

raffaellasuardini
Copy link
Contributor

  • updated .pre-commit-config.yaml: inserted ruff and pre-commit hooks

  • created Ruff configuratio in pyproject.toml

djangocms_alias/constants.py Fixed Show resolved Hide resolved
ALIAS_MENU_CREATE_IDENTIFIER = 'alias-add'
ALIAS_LANGUAGE_BREAK = 'alias-language'
ALIAS_MENU_IDENTIFIER = "alias"
ALIAS_MENU_CREATE_IDENTIFIER = "alias-add"

Check notice

Code scanning / CodeQL

Unused global variable Note

The global variable 'ALIAS_MENU_CREATE_IDENTIFIER' is not used.
long_description=open('README.rst').read(),
long_description_content_type='text/x-rst',
platforms=['OS Independent'],
long_description=open("README.rst").read(),

Check warning

Code scanning / CodeQL

File is not always closed Warning

File is opened but is not closed.
djangocms_alias/constants.py Fixed Show resolved Hide resolved
@marksweb marksweb changed the title Update pre-commit checks chore: Update pre-commit checks Feb 5, 2024
@marksweb
Copy link
Member

marksweb commented Feb 5, 2024

The test failures might be a clue as to a change.

For the most part it's a case of this string\n in the test being asserted as this string so perhaps something in the test setup that's causing a newline character.

@marksweb
Copy link
Member

marksweb commented Feb 5, 2024

@fsbraun If you've got some time, could you take a look and see if I'm missing something with the tests?

{{ instance.body|safe }}
Copy link
Member

@fsbraun fsbraun Feb 5, 2024

Choose a reason for hiding this comment

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

@raffaellasuardini Here, a newline has been added which must be removed. Sometimes editors do this. I have had this issue with PyCharm, for example.
Maybe this already fixes the failing tests?

Copy link
Member

Choose a reason for hiding this comment

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

It's the .editorconfig file which says insert_final_newline = true on all file types.

@raffaellasuardini I think it's worth updating this block in there;

[*.{scss,js,html}]
max_line_length = 120
indent_style = space
quote_type = double

Update that to:

[*.{scss,js,html}]
max_line_length = 120
indent_style = space
insert_final_newline = false
quote_type = double

Copy link
Member

Choose a reason for hiding this comment

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

Ah, there we go. I'll also have to do this for djanogcms-text[-ckeditor]...

@marksweb marksweb marked this pull request as draft February 9, 2024 13:50
@marksweb marksweb marked this pull request as ready for review February 9, 2024 13:50
@marksweb marksweb merged commit 24178ef into django-cms:master Feb 9, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants