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

[#530] Implement code formatting and checks for backend #542

Merged

Conversation

placek
Copy link
Contributor

@placek placek commented Mar 25, 2024

Closes #530.

In response to the user story requesting the implementation of code formatting and checks for the backend to ensure a consistent code style, this pull request aims to add stylish-haskell to the developer's toolset. By incorporating stylish-haskell into the backend project, developers gain access to a standardized code formatting guide, promoting code quality and consistency. The addition involves updating the default.nix file within the govtool/backend directory, ensuring that stylish-haskell becomes an essential aspect of the tools dependencies for maintaining a uniform code style effortlessly.

The inclusion of stylish-haskell enhances the developer's configuration in the backend, granting developers the ability to enforce consistent code formatting standards easily. This enhancement contributes to a more streamlined and coherent codebase, aligning with the goal of establishing a unified code style across the backend project.

@placek placek added this to the Open source preparation milestone Mar 25, 2024
@placek placek self-assigned this Mar 25, 2024
@placek placek marked this pull request as ready for review March 25, 2024 10:49
placek added 10 commits March 28, 2024 06:16
In response to the user story task requesting the implementation of code
formatting and checks for the backend to ensure a consistent code style,
this commit addresses a broken configuration in the Haskell backend. The
changes made focus on correcting the Haskell backend developer's
configuration, enabling a more reliable code formatting and checking
process to be established.

The modifications include fixing the broken configuration by adjusting
the Haskell backend's default.nix file. This involves fixing the mechanism
that appends additional libraries and tools required for the project,
and making necessary adjustments to the project's modifier and overrides
for proper functionality and adherence to the defined code style.
In response to the user story's requirement to implement code formatting
and checks for the backend to ensure a consistent code style, this
commit focuses on enhancing the reliability and responsiveness of the
direnv nix-shell helpers in the Haskell backend configuration. The
changes aim to improve the configuration by making adjustments to the
default.nix file and .envrc file to enhance the development environment
for backend developers.

The modifications in this commit include updating the .envrc file to
watch additional files for changes, specifically the vva-be.cabal and
default.nix files. Furthermore, changes were made in the default.nix
file to provide more informative messages to developers interacting with
the project by dynamically referencing the README.md file. These
adjustments are aimed at creating a more efficient and user-friendly
development environment for backend developers.
In line with the user story's objective of implementing code formatting
and checks for the backend to ensure a consistent code style, this
commit focuses on enhancing the developer's configuration in the backend
project. By adding stylish-haskell to the tools dependencies, backend
developers will now have access to this code formatting tool, enabling
them to maintain a standardized code style effortlessly.

The modification in this commit involves updating the default.nix file
within the govtool/backend directory. The addition of stylish-haskell to
the list of tools dependencies ensures that developers can utilize this
tool to enforce consistent code formatting standards, thereby
contributing to a unified and coherent codebase across the backend
project.
In alignment with the user story's objective to implement code
formatting and checks for the backend to ensure a consistent code style,
this commit includes the addition of hlint to the project's build tools
within the default.nix file. By introducing hlint to the backend's
development environment, developers can leverage this static code
analysis tool to further enhance the code quality and maintain adherence
to the defined code style standards.

The main change in this commit involves editing the default.nix file
located in the govtool/backend directory. Specifically, the modification
adds hlint to the list of build tools, enabling backend developers to
utilize this tool for static code analysis alongside other existing
tools like cabal-install, haskell-language-server, and stylish-haskell.
This enhancement contributes to the establishment of a comprehensive
code formatting and checking mechanism, promoting code consistency and
quality within the backend project.
In alignment with the user story's objective to implement consistent
code style in the backend, this commit adds a stylish-haskell
configuration to the backend project. The inclusion of the
.stylish-haskell.yaml file provides a standardized code formatting guide
for developers, enhancing the code quality and style consistency across
the codebase. By incorporating stylish-haskell as a code formatting
tool, developers can adhere to established formatting rules effortlessly
and maintain a uniform code style throughout the project.

The key modification in this commit consists of adding the
.stylish-haskell.yaml file to the govtool/backend directory. This
configuration file outlines various code formatting rules and settings,
including module header formatting, record definitions, import
alignment, language pragmas, and more. It serves as a reference point
for developers to ensure their code aligns with the defined style
guidelines, supporting the establishment of a streamlined and coherent
coding standard within the backend project.
The changes primarily involve modifying the default.nix files in
govtool/frontend and scripts/govtool directories. Specifically, the
adjustments establish a connection between the shell messages and the
pertinent README.md files, offering developers immediate access to
additional insights and details related to the frontend development and
deployment processes, respectively. This enhancement facilitates a more
streamlined and informative user experience within the development
environment, aligning with the goal of ensuring consistent code style
throughout the backend project.
In adherence to the user story's objective of implementing code
formatting and checks for the backend to ensure a consistent code style,
this commit enhances the documentation within the backend module. By
incorporating instructions on utilizing development tools like `hlint`,
`stylish-haskell`, and `Haskell-Language-Server` within the README.md
file, developers gain valuable insights into applying linting,
formatting, and language server capabilities to optimize the code
quality and maintain uniformity across the backend project.
In response to the user story's requirement to implement code formatting
and checks for the backend to ensure a consistent code style, this
commit focuses on optimizing the flake configuration within the project.
By using flake-parts, the organization of the flake is enhanced,
promoting better management of configurations and dependencies. This
adjustment aligns with the overarching goal of establishing a
standardized code style and formatting mechanism to maintain code
uniformity across the backend project.
This commit addresses the user story's requirement to implement code
formatting and checks for the backend by introducing the pre-commit tool
with a basic configuration. The pre-commit tool is added to the project
to automate and standardize the process of checking code before commits,
ensuring consistent code style and quality throughout the backend
development.

By installing the pre-commit tool and configuring it with essential
hooks, developers can automate code checking processes and adhere to
defined code style standards seamlessly within the backend project.
This is an application of the trailing-whitespace and end-of-file-fixer
hooks, to make the repository clean.
@placek placek force-pushed the chore/530-implement-code-formatting-and-checks-for-backend branch from e568a2a to 6b40e80 Compare March 28, 2024 07:09
@placek placek requested a review from adgud as a code owner March 28, 2024 07:09
@placek placek requested review from jankun4 and MSzalowski March 28, 2024 07:14
In response to the user story's requirement to implement code formatting
and checks for the backend to ensure a consistent code style, this
commit focuses on enhancing the pre-commit configuration by
incorporating hlint and stylish-haskell. By adding these tools to the
pre-commit workflow, developers can now automatically check code quality
and enforce consistent code formatting standards before committing
changes. This enhancement aligns with the goal of promoting code
consistency and adherence to the defined code style guidelines within
the backend project.
placek added 2 commits March 28, 2024 10:03
To keep the repository clean this commit introduces all the changes that
apply the hlint and stylish-haskell hints. By introducing this change
developers will not need to do the chore of applying those hints in
future.
In order to fulfill the user story's requirement of implementing code
formatting and checks for the backend to ensure a consistent code style,
this commit introduces a new GitHub workflow specifically designed to
verify the Haskell code within the backend module. The workflow is
configured to run upon triggering the workflow by pushing changes to
files within the govtool/backend directory, aiming to enforce code
quality and formatting standards automatically.
@placek placek force-pushed the chore/530-implement-code-formatting-and-checks-for-backend branch from 7ee4473 to 0a28336 Compare March 28, 2024 09:04
@placek placek merged commit 65fd617 into develop Mar 28, 2024
@placek placek deleted the chore/530-implement-code-formatting-and-checks-for-backend branch March 28, 2024 09:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Implement code formatting and checks for backend
3 participants