-
Notifications
You must be signed in to change notification settings - Fork 24
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
Scala linter and formatter #3357
Conversation
I let the scalafmt run on the code basis and corrected most linter errors or surpressed them for certain methods, so this is a pretty huge change. I think after the tracing store merge would be a good time to merge this change as there are no other open backend prs. |
@jstriebel @rschwanhold please have a look at the resulting code style. (1) Do you think it is a good idea to have a formatter in place? And (2), should we change its config? |
@youri-k can you explain the differences in the snapshots? What happened here / did you fix bugs in the code? How does the user-facing behavior change? Thanks! |
_ <- Fox.runOptional(request.identity) { user => | ||
if (typ == AnnotationType.Task || typ == AnnotationType.Explorational) { | ||
if (typedType == AnnotationType.Task || typedType == AnnotationType.Explorational) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The changes in the snapshots were necessary because this condition is now checed correctly. Due to this change the annotation snapshot depended on the time between the first and the second call of this route. This time changes from run to run, so it isn't a good idea to check this. The test already implemented a method to replace volatile values, so I added the key tracingTime
to be replaced and called it in the specific test. This lead to the changes in the annotation snapshot, where other volatile values are now replaced, too and to the changes in the task snapshot. Regarding the now changed values in the annotation snapshot, I added a check for the annotation id and the skeleton id as they're not volatile in this scenario.
The user-facing doesn't really change except for the fact we may log additional time because of corrected check.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
The only thing that we could discuss is if we really don't want to use curly brackets around a method that has only one statement:
override def onNotAuthenticated(implicit request: RequestHeader): Future[Result] =
Future.successful(Unauthorized(Messages("user.notAuthorised")))
This example is pretty obvious, but another example is:
override def routeRequest(request: RequestHeader): Option[Handler] =
if (request.uri.matches("^(/api/|/data/|/assets/).*$")) {
super.routeRequest(request)
} else {
Some(Action { Ok(views.html.main(conf)) })
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Please merge only after tracingstore (#3281 )
@jstriebel Please take a look as well because this would enforce all backend code to correspond to this style. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome PR!
b3fd849
to
050fe16
Compare
* master: Fix rgb support (#3455) Fix docker uid/gid + binaryData permissions. Persist postgres db (#3428) Script to merge volume tracing into on-disk segmentation (#3431) Hotfix for editing TaskTypes (#3451) fix keyboardjs module (#3450) Fix guessed dataset boundingbox for non-zero-aligned datasets (#3437) voxeliterator now checks if the passed map has elements (#3405) integrate .importjs (#3436) Re-write logic for selecting zoom level and support non-uniform buckets per dimension (#3398) fixing selecting bug and improving style of layout dropdown (#3443) refresh screenshots (#3445) Reduce the free space between viewports in tracing (#3333) Scala linter and formatter (#3357) ignore reported datasets of non-existent organization (#3438) Only provide shortcut for tree search and not for comment search (#3407) Update Datastore+Tracingstore Standalone Deployment Templates (#3424) In yarn refresh-schema, also invalidate Tables.scala (#3430) Remove BaseDirService that watched binaryData symlinks (#3416) Ensure that resolutions array is dense (#3406) Fix bucket-collection related rendering bug (#3409)
Steps to test:
Issues:
- [ ] Updated changelog- [ ] Updated migration guide if applicable- [ ] Updated documentation if applicable- [ ] Needs datastore update after deployment