Skip to content

Conversation

@mfjarvis
Copy link
Contributor

@mfjarvis mfjarvis commented Oct 8, 2025

Summary

  • Routine Change

Changes:

  • Add husky to manage git hooks.
  • Add lint-staged to run linters & formatters on staged files.
  • Add prettier to format .md, .json, .yml files etc.
  • Add black to format .py files.
  • Create separate quality_checks project using Python 3.11 so we can lint and format with the latest versions of flake8 and black.
  • Update .editorconfig to remove some unnecessary overrides and format .yml files according to our code style.
  • Split existing lint pipeline into two - one for the Node.js project and one for the Python project.
  • Run flake8 and black on all Python files. Fix lint errors (except some line too long errors in tests, which are currently ignored).
  • Run terraform fmt on all Terraform files.
  • Run prettier on all supported files.

Reviews Required

  • Dev
  • Test
  • Tech Author
  • Product Owner

Review Checklist

ℹ️ This section is to be filled in by the reviewer.

  • I have reviewed the changes in this PR and they fill all or part of the acceptance criteria of the ticket, and the code is in a mergeable state.
  • If there were infrastructure, operational, or build changes, I have made sure there is sufficient evidence that the changes will work.
  • I have ensured the changelog has been updated by the submitter, if necessary.

@github-actions
Copy link
Contributor

github-actions bot commented Oct 8, 2025

This branch is working on a ticket in the NHS England VED JIRA Project. Here's a handy link to the ticket:

VED-000

dlzhry2nhs
dlzhry2nhs previously approved these changes Oct 9, 2025
Copy link
Contributor

@dlzhry2nhs dlzhry2nhs left a comment

Choose a reason for hiding this comment

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

Looks great - just asked question in Slack as to whether any instructions/links need to be added to the README to advise developers on how to run Python linting manually, and how to set up husky for pre-commits (if it is a step that is needed).

dlzhry2nhs
dlzhry2nhs previously approved these changes Oct 9, 2025
@sonarqubecloud
Copy link

sonarqubecloud bot commented Oct 9, 2025

"lint-staged": "^16.2.3",
"prettier": "^3.6.2"
},
"lint-staged": {
Copy link
Contributor

Choose a reason for hiding this comment

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

Nice!

jobs:
lint:
name: Lint specification and Python projects
lint-specification:
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we also wanna run the same prettier checks and tf fmt check that we have for pre-commits in the pipeline in case someone does not have them switched on locally?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah good shout. Will create a small follow up PR for this and some README changes

@mfjarvis mfjarvis merged commit 80cf47d into master Oct 10, 2025
8 checks passed
@mfjarvis mfjarvis deleted the VED-000-formatting-and-linting branch October 10, 2025 08:52
mfjarvis added a commit that referenced this pull request Oct 22, 2025
* Add black for code formatting. Remove some linting exclusions. Fix errors.

* Fix path.

* Don't install quality_checks package.

* Fix commands.

* Update pre-commit script.

* Add lint-staged to lint and format staged files only.

* Add husky to manage commit hooks.

* Add prettier for MD / YAML / JSON formatting.

* Resolve some Sonar warnings.

* Add .prettierignore and run prettier on all supported files.

* Revert auto formatting of jsc files.

* Fix lint error.

* Format Terraform.
mfjarvis added a commit that referenced this pull request Oct 27, 2025
* Add black for code formatting. Remove some linting exclusions. Fix errors.

* Fix path.

* Don't install quality_checks package.

* Fix commands.

* Update pre-commit script.

* Add lint-staged to lint and format staged files only.

* Add husky to manage commit hooks.

* Add prettier for MD / YAML / JSON formatting.

* Resolve some Sonar warnings.

* Add .prettierignore and run prettier on all supported files.

* Revert auto formatting of jsc files.

* Fix lint error.

* Format Terraform.
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.

2 participants