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

Add initial version of miss_hit #741

Merged
merged 9 commits into from
Dec 23, 2024
Merged

Conversation

mvanzulli
Copy link
Member

Following: #677 (comment) I added an initial local version of the formatter so we can start slowly disucssion conventions as well as set up details

# Reference: https://florianschanda.github.io/miss_hit/style_checker.html

# Maximum allowed length for a single line of code (in characters)
# Helps maintain code readability without unnecessary horizontal scrolling.
Copy link
Member Author

Choose a reason for hiding this comment

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

Probably here we want to align on what is going to be the convention as in the current version is still erroring:

Copy link
Member Author

Choose a reason for hiding this comment

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

Checking code formatting in ./../docs/ ./../test/...
poetry run mh_style ./../docs/ ./../test/
In ../docs/src/bringONSASmFilesToONSASdocs.m, line 1
| % md function used to conver .m files in the ONSAS repo to .md files in this repo
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ style: No copyright notice found in docstring [copyright_notice]
In ../docs/src/bringONSASmFilesToONSASdocs.m, line 6
| function bringONSASmFilesToONSASdocs
|          ^^^^^^^^^^^^^^^^^^^^^^^^^^^ style: violates naming scheme for function [naming_functions]
In ../docs/src/m2md.m, line 1
| function m2md(fileIn, fileOut, includeCodeBoolean, iniLine)
|          ^^^^ style: violates naming scheme for function [naming_functions]
In ../docs/src/m2md.m, line 1
| function m2md(fileIn, fileOut, includeCodeBoolean, iniLine)
|          ^^^^ style: Could not find any copyright notice [copyright_notice]
In ../test/gaussIntegrationTest.m, line 1
| % ========================================================================================
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ style: No copyright notice found in docstring [copyright_notice]
In ../test/gaussIntegrationTest.m, line 4
| function resultBoolean = gaussIntegrationTest()
|                          ^^^^^^^^^^^^^^^^^^^^ style: violates naming scheme for function [naming_functions]
In ../test/gaussIntegrationTest.m, line 56
| function ys = test_fun_to_integrate(xinput)
|               ^^^^^^^^^^^^^^^^^^^^^ style: violates naming scheme for function [naming_functions]
../test/runTestProblems_local.m: style: violates naming scheme for scripts [naming_scripts]
In ../test/runTestProblems_moxunit_disp.m, line 1
| % function for testing ONSAS using moxunit
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ style: No copyright notice found in docstring [copyright_notice]
In ../test/runTestProblems_moxunit_disp.m, line 3
| function test_suite = runTestProblems_moxunit_disp
|                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ style: violates naming scheme for function [naming_functions]
In ../test/runTestProblems_moxunit_disp.m, line 16
| function test_1
|          ^^^^^^ style: violates naming scheme for function [naming_functions]
In ../test/runTestProblems_moxunit_disp.m, line 20
| function test_2
|          ^^^^^^ style: violates naming scheme for function [naming_functions]
In ../test/runTestProblems_moxunit_disp.m, line 24
| function test_3
|          ^^^^^^ style: violates naming scheme for function [naming_functions]
In ../test/runTestProblems_moxunit_disp.m, line 28
| function test_4
|          ^^^^^^ style: violates naming scheme for function [naming_functions]
In ../test/runTestProblems_moxunit_disp.m, line 32
| function test_5
|          ^^^^^^ style: violates naming scheme for function [naming_functions]
In ../test/runTestProblems_moxunit_disp.m, line 36
| function test_6
|          ^^^^^^ style: violates naming scheme for function [naming_functions]
In ../test/runTestProblems_moxunit_disp.m, line 40
| function test_7
|          ^^^^^^ style: violates naming scheme for function [naming_functions]
In ../test/runTestProblems_moxunit_disp.m, line 44
| function test_8
|          ^^^^^^ style: violates naming scheme for function [naming_functions]
In ../test/runTestProblems_moxunit_disp.m, line 48
| function test_9
|          ^^^^^^ style: violates naming scheme for function [naming_functions]
In ../test/runTestProblems_moxunit_disp.m, line 52
| function test_10
|          ^^^^^^^ style: violates naming scheme for function [naming_functions]
In ../test/runTestProblems_moxunit_disp.m, line 56
| function test_11
|          ^^^^^^^ style: violates naming scheme for function [naming_functions]
In ../test/runTestProblems_moxunit_disp.m, line 60
| function test_12
|          ^^^^^^^ style: violates naming scheme for function [naming_functions]
In ../test/runTestProblems_moxunit_disp.m, line 64
| function test_13
|          ^^^^^^^ style: violates naming scheme for function [naming_functions]
In ../test/runTestProblems_moxunit_disp.m, line 68
| function test_14
|          ^^^^^^^ style: violates naming scheme for function [naming_functions]
In ../test/runTestProblems_moxunit_disp.m, line 72
| function test_15
|          ^^^^^^^ style: violates naming scheme for function [naming_functions]
In ../test/runTestProblems_moxunit_disp.m, line 76
| function test_16
|          ^^^^^^^ style: violates naming scheme for function [naming_functions]
In ../test/runTestProblems_moxunit_disp.m, line 80
| function test_17
|          ^^^^^^^ style: violates naming scheme for function [naming_functions]
In ../test/runTestProblems_moxunit_disp.m, line 84
| function test_18
|          ^^^^^^^ style: violates naming scheme for function [naming_functions]
In ../test/runTestProblems_moxunit_disp.m, line 88
| function test_19
|          ^^^^^^^ style: violates naming scheme for function [naming_functions]
In ../test/runTestProblems_moxunit_disp.m, line 92
| function test_20
|          ^^^^^^^ style: violates naming scheme for function [naming_functions]
In ../test/runTestProblems_moxunit_disp.m, line 96
| function test_21
|          ^^^^^^^ style: violates naming scheme for function [naming_functions]
In ../test/runTestProblems_moxunit_disp.m, line 100
| function test_22
|          ^^^^^^^ style: violates naming scheme for function [naming_functions]
MISS_HIT Style Summary: 5 file(s) analysed, 32 style issue(s)
make: *** [Makefile:26: format_check] Error 1

Copy link
Member

@jorgepz jorgepz Dec 16, 2024

Choose a reason for hiding this comment

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

Yes, however this could be solved in another PR? maybe this pr adds miss_hit and in another we define the format... and in another we add this to the CI

Copy link
Member Author

Choose a reason for hiding this comment

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

Makes sense, we can do that. Merge the machinery and then we can decide, I was thinking the automation of pre-commit can be added in a different PR after we clean all formats issues.

Copy link
Member Author

Choose a reason for hiding this comment

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

I've tried to describe the plan #677 (comment), feel free to edit or modify as you consider the best to do a safe and sound auto formatting migration.

@mvanzulli mvanzulli requested a review from jorgepz December 15, 2024 20:29
Copy link

codecov bot commented Dec 15, 2024

Codecov Report

Attention: Patch coverage is 16.42857% with 117 lines in your changes missing coverage. Please review.

Project coverage is 89.46%. Comparing base (b7ee21c) to head (243d724).
Report is 8 commits behind head on master.

Files with missing lines Patch % Lines
test/runTestProblems_moxunit_disp.m 0.00% 45 Missing ⚠️
docs/src/bringONSASmFilesToONSASdocs.m 0.00% 27 Missing ⚠️
docs/src/m2md.m 0.00% 23 Missing ⚠️
test/runTestProblems_local.m 0.00% 22 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #741      +/-   ##
==========================================
- Coverage   89.65%   89.46%   -0.19%     
==========================================
  Files         131      131              
  Lines        4649     4661      +12     
==========================================
+ Hits         4168     4170       +2     
- Misses        481      491      +10     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@mvanzulli mvanzulli self-assigned this Dec 16, 2024
docs/src/m2md.m Outdated Show resolved Hide resolved
@jorgepz
Copy link
Member

jorgepz commented Dec 16, 2024

Thanks for the PR @mvanzulli ! This is a very nice improvement for the project.

Copy link
Member

@jorgepz jorgepz left a comment

Choose a reason for hiding this comment

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

The deployment of the docs is not working since the length of the %md string changed

Co-authored-by: Jorge Pérez Zerpa <[email protected]>
@mvanzulli
Copy link
Member Author

The deployment of the docs is not working since the length of the %md string changed

Good point I found that, proably we will need to support both or strip spaces while we do the migration. However I see http://www.onsas.org/previews/PR741/ is deployed correctly in this PR and why the tests are passing ?

@jorgepz jorgepz merged commit 5595236 into master Dec 23, 2024
6 of 8 checks passed
@jorgepz jorgepz deleted the mvanzulli/677-initial-version branch December 23, 2024 17:33
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