Skip to content

Reformat code with default formatter#18

Merged
SCratORS merged 1 commit intoSCratORS:mainfrom
Doctoror:reformat
Feb 10, 2024
Merged

Reformat code with default formatter#18
SCratORS merged 1 commit intoSCratORS:mainfrom
Doctoror:reformat

Conversation

@Doctoror
Copy link
Copy Markdown
Contributor

@Doctoror Doctoror commented Feb 9, 2024

The reason is that usually I run automatic formatter after every change, and I get unrelated changes in diffs.

Also, I am working on increasing the frame rate by generating new frames, it would be nice if the frames are also formatted.

Changes:

  • reformat with default Android Studio formatter
  • organize imports
  • disable formatting for some parts of code
  • mark final classes and variables as final
  • reduce visibility to package-private where possible
  • use conventional naming pattern for constants

No changes in logic or values.

Reason to use final modifiers:

  • protects from accidental change
  • when reading the code, if variables are final you know right away that they are never changed

Reason for reducing visibility scope (adding private and replacing with package-private):

  • easier to understand where the code is used from when reading

- reformat with default Android Studio formatter
- organize imports
- disable formatting for some parts of code
- mark final classes and variables as final
- reduce visibility to package-private where possible
- use conventional naming pattern for constants
- move render and setupPosition to base class to avoid class lookup

No changes in logic or values
@SCratORS SCratORS merged commit fb99341 into SCratORS:main Feb 10, 2024
@Doctoror Doctoror deleted the reformat branch February 11, 2024 21:04
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