Skip to content
This repository has been archived by the owner on Apr 24, 2024. It is now read-only.

coding guidelines #72

Merged
merged 23 commits into from
Mar 12, 2023
Merged

coding guidelines #72

merged 23 commits into from
Mar 12, 2023

Conversation

kitzbergerg
Copy link
Contributor

As part of #60 I want to enable all clippy lints that seem useful.

This also includes adding documentation to all methods and modules in the backend.

After all clippy lints are active there might not even be a need to write additional coding guidelines (as clippy can be quite strict).

@kitzbergerg
Copy link
Contributor Author

@markus2330 Please have a lot at the metadata I added to the toml file. I put in there what clippy wanted and tried to piece together what I think would make sense.

Copy link
Contributor

@markus2330 markus2330 left a comment

Choose a reason for hiding this comment

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

Amazing investigation! Really like the many lints ❤️

Only two very minor points, see comments.

Some of them might be too much, e.g. partial_pub_fields, but lets see if we hit them.

backend/src/main.rs Show resolved Hide resolved
backend/src/main.rs Show resolved Hide resolved
@kitzbergerg
Copy link
Contributor Author

I'm kind of finished with what I can do in this PR for now (not yet to be merged).

I documented where I could in code and left TODOs where I didn't really know what to write (e.g. struct fields that represent the database). For that I would need some good documentation or some help to tell me what the individual fields are actually for (maybe discuss that on Tuesday or somebody helps me after the meeting).

Then there is still #![allow(clippy::module_name_repetitions)]. I don't actually know whether we want that, but I can't really do anything about that currently as I'm kind of blocked from renaming file by #48 (we did some renaming there and that would result in a huge merge conflict mess).

@kitzbergerg
Copy link
Contributor Author

@markus2330 To view the docs type cargo doc --open and the generated html files should open in the browser. It's easier to look through code that way.

Copy link
Contributor

@markus2330 markus2330 left a comment

Choose a reason for hiding this comment

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

Great job! ❤️

  • please also add how to add documentation cargo doc --open to the documentation (README.md)
  • struct fields that represent the database: Yes, good idea to document it here. Define database layout for plant hierarchy #48 and others can add documentation there.
  • module_name_repetitions: I am all for not repeating module names. Not having to do that, is one of the main reasons why modules exists.

backend/src/config/app.rs Outdated Show resolved Hide resolved
backend/src/constants.rs Outdated Show resolved Hide resolved
backend/src/main.rs Outdated Show resolved Hide resolved
backend/src/models/dto/variety_dto.rs Outdated Show resolved Hide resolved
backend/src/models/seed.rs Outdated Show resolved Hide resolved
@kitzbergerg kitzbergerg marked this pull request as ready for review March 11, 2023 11:06
@kitzbergerg kitzbergerg requested a review from markus2330 March 11, 2023 11:06
@kitzbergerg
Copy link
Contributor Author

@lukashartl Once this PR is merge you probably need to change CI. There should be an additional check whether documentation links are broken. The command for that is cargo doc.

@markus2330 It is possible to set a flag in rust to deny warnings (rust-lang/cargo#8424 (comment)). We might want to enable that.

@markus2330 markus2330 mentioned this pull request Mar 12, 2023
4 tasks
@markus2330
Copy link
Contributor

@lukashartl Once this PR is merge you probably need to change CI. There should be an additional check whether documentation links are broken. The command for that is cargo doc.

@markus2330 It is possible to set a flag in rust to deny warnings (rust-lang/cargo#8424 (comment)). We might want to enable that.

I created #98 to track this, the deployment is higher priority though.

@markus2330 markus2330 merged commit ed1c971 into master Mar 12, 2023
@markus2330 markus2330 deleted the feature/#60-backend-coding-guidelines branch March 12, 2023 07:27
@markus2330
Copy link
Contributor

Great work! Now please concentrate on documentation, architecture, big picture of backend etc., so that we can finish the first milestone without bigger merge conflicts.

@kitzbergerg
Copy link
Contributor Author

Great work! Now please concentrate on documentation, architecture, big picture of backend etc., so that we can finish the first milestone without bigger merge conflicts.

There are still a few smaller issues open. I will quickly fix them and afterwards start with the doc/decisions.

@markus2330 markus2330 mentioned this pull request Mar 16, 2023
6 tasks
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants