abap icon indicating copy to clipboard operation
abap copied to clipboard

implement exercise: Difference of squares

Open Dwivedirahul44 opened this issue 3 years ago • 12 comments

closes: #236

Dwivedirahul44 avatar Oct 26 '22 15:10 Dwivedirahul44

@larshp - do you think it's a bug? a down porting issue? The below code works:

data num type i.
data num_x type i.
num = 5.
num_x = ( ( num * ( num + 1 ) ) / 2 ).
write ipow( base = num_x exp = 2 ).

image

But this doesn't => output 1.

data num type i.
num = 5.
write ipow( base = ( ( num * ( num + 1 ) ) / 2 ) exp = 2 ).

image

Dwivedirahul44 avatar Oct 26 '22 16:10 Dwivedirahul44

We want to keep the repo compatible with abapGit. I'm not sure how you are editing the files but your editor is not following the rules set by .editorconfig. Source files .abap need an empty line at the end of the file. .xml files also need an empty line at the end and a UTF-8 BOM (0xEF,0xBB,0xBF) at the beginning of the file (note: it's not visible in GitHub). The easiest is to copy an existing .xml from the repo and adjust accordingly (or create the objects in an ABAP system and use abapGit to push them to the repo).

mbtools avatar Oct 27 '22 16:10 mbtools

@mbtools - thanks for pointing this out, I learned something new. is there a way for me to verify that I am complying with the .editorconfig rule so I know that I haven't messed up anything while making manual addition/changes on GitHub? I have used vscode online(github.dev) editor to reverify files of this PR while resolving conflict.

Dwivedirahul44 avatar Oct 27 '22 19:10 Dwivedirahul44

The files are not correct yet. You can see in https://github.com/exercism/abap/pull/242/files how I corrected some of the other files. The end-of-file is easy to add. For the BOM value, copy older XMLs for example from https://github.com/exercism/abap/tree/main/exercises/practice/hello-world.

As far as I know, VScode does not use the .editorconfig in the repo automatically. Try it with extension https://github.com/editorconfig/editorconfig-vscode.

mbtools avatar Oct 27 '22 23:10 mbtools

The files are not correct yet. You can see in https://github.com/exercism/abap/pull/242/files how I corrected some of the other files. The end-of-file is easy to add. For the BOM value, copy older XMLs for example from https://github.com/exercism/abap/tree/main/exercises/practice/hello-world.

As far as I know, VScode does not use the .editorconfig in the repo automatically. Try it with extension https://github.com/editorconfig/editorconfig-vscode.

Thank you, this helps a lot.

Dwivedirahul44 avatar Oct 28 '22 08:10 Dwivedirahul44

@mbtools @larshp - Please review and provide feedback.

Dwivedirahul44 avatar Oct 31 '22 10:10 Dwivedirahul44

Please rename the folder from difference-of-squares to difference-of-squar to avoid this error in abapGit:

image

Otherwise it looks good

mbtools avatar Oct 31 '22 14:10 mbtools

"difference-of-squares" is the correct name of the exercise...

larshp avatar Nov 07 '22 05:11 larshp

Who cares about a folder name? :-)

mbtools avatar Nov 07 '22 11:11 mbtools

configlet will give an error if the slug and folder does not match, https://github.com/exercism/abap/actions/runs/3410469426/jobs/5673465648

the icon is determined via the slug name

larshp avatar Nov 07 '22 12:11 larshp

@mbtools @larshp: do we want to ditch the exercise and any other with names larger than 20 characters( $EXERCISM_ being 10 )? if yes, then it will make sense to add to contribution guidelines.

Dwivedirahul44 avatar Nov 09 '22 14:11 Dwivedirahul44

well, I think we need to find a solution that works for both contributors and students wanting to pull exercises via abapGit

this repository can have the default Exercism structure, and then possibly have an automatic clone possibly without the deep folder structure

larshp avatar Nov 09 '22 15:11 larshp

@Dwivedirahul44 check conflicts

larshp avatar Dec 02 '22 13:12 larshp

@Dwivedirahul44 check conflicts

larshp avatar Dec 12 '22 07:12 larshp

@larshp - apologies for missing the merge conflict. Do we want to hold off on this exercise till we have a workaround/solution for 30 character limit of package names? or push this ahead? I will delete the PR if we decide to hold.

Dwivedirahul44 avatar Dec 12 '22 21:12 Dwivedirahul44

merge

larshp avatar Dec 13 '22 06:12 larshp