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

Remove tabs and unused local variables (DONE) #5275

Merged
merged 4 commits into from
Jan 10, 2023

Conversation

james-d-mitchell
Copy link
Contributor

This PR removes all tabs and unused local variables from files starting "c" in the library. There were no tabs and no unused local variables in files starting "b" in the library, hence the lack of a PR for these.

Text for release notes

None

@james-d-mitchell james-d-mitchell changed the title Remove tabs c files Remove tabs and unused local variables from "c" files Dec 15, 2022
@fingolfin
Copy link
Member

For the sake of efficiency, and to avoid having 20+ "convert tab commits" in the history and the .git-blame-ignore-revs, we could also have multiple of these "convert tabs" commits in a single PR; then we can review commit-by-commit to double check. And once all commits are "there" and reviewed, we could squash-merge.

This might also be easier for you compared to making many separate PRs?

That said, I am totally fine either way

@fingolfin fingolfin added topic: library release notes: not needed PRs introducing changes that are wholly irrelevant to the release notes labels Dec 15, 2022
@james-d-mitchell
Copy link
Contributor Author

I can do that if it's preferable, I thought you'd asked for a number of smaller PR's rather than one massive one, but perhaps I misunderstood.

@james-d-mitchell james-d-mitchell marked this pull request as draft December 15, 2022 15:47
@james-d-mitchell james-d-mitchell changed the title Remove tabs and unused local variables from "c" files WIP: Remove tabs and unused local variables (done files starting "a" to "c") Dec 15, 2022
@james-d-mitchell james-d-mitchell changed the title WIP: Remove tabs and unused local variables (done files starting "a" to "c") Remove tabs and unused local variables (done files starting "a" to "h") Dec 17, 2022
@james-d-mitchell james-d-mitchell marked this pull request as ready for review December 17, 2022 18:09
@james-d-mitchell
Copy link
Contributor Author

I think it might take me a little while to do the rest of the files in the library, and it might be easier to merge this PR sooner rather than later (if it's acceptable) since otherwise the PR and master will diverge and become harder to merge.

Copy link
Member

@fingolfin fingolfin left a comment

Choose a reason for hiding this comment

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

Some minor oddities... no worries, we'll figure them out and then can merge (squash-merge?) this PR soonish. Need to sleep now, though

lib/clashom.gi Outdated Show resolved Hide resolved
lib/clashom.gi Show resolved Hide resolved
lib/clashom.gi Outdated Show resolved Hide resolved
lib/clas.gi Outdated Show resolved Hide resolved
lib/clashom.gi Outdated Show resolved Hide resolved
@james-d-mitchell james-d-mitchell changed the title Remove tabs and unused local variables (done files starting "a" to "h") Remove tabs and unused local variables (done files starting "a" to "m") Dec 20, 2022
@james-d-mitchell james-d-mitchell changed the title Remove tabs and unused local variables (done files starting "a" to "m") Remove tabs and unused local variables (done files starting "a" to "t") Dec 22, 2022
@james-d-mitchell james-d-mitchell changed the title Remove tabs and unused local variables (done files starting "a" to "t") Remove tabs and unused local variables (DONE) Dec 22, 2022
@james-d-mitchell
Copy link
Contributor Author

@fingolfin this is now complete, I've removed all unused local variables and tabs from lib/*.

Copy link
Contributor

@ChrisJefferson ChrisJefferson left a comment

Choose a reason for hiding this comment

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

I had a quick look through and these all seem sensible. I looked closely at a few places where local variables had very suspicious names (like PrintObj or Error), but these variables were never used for anything, so removing them is safe (and good).

@james-d-mitchell
Copy link
Contributor Author

Thanks @ChrisJefferson, I was going to say: I'll squash the commits which remove tabs into one, and the same for the commits removing unused local variables, if this PR gets the green light.

@fingolfin
Copy link
Member

Thanks I'll have a look in a bit, too.

I am slightly vary about the files in hpcgap/lib/ getting out of sync. Perhaps there aren't too many tabs in them, though?

1 similar comment
@fingolfin
Copy link
Member

Thanks I'll have a look in a bit, too.

I am slightly vary about the files in hpcgap/lib/ getting out of sync. Perhaps there aren't too many tabs in them, though?

@james-d-mitchell
Copy link
Contributor Author

Good point @fingolfin, there are apparently 167 lines with tabs in hpcgap/lib and a grand total of two local variables declared but not used.

Copy link
Member

@fingolfin fingolfin left a comment

Choose a reason for hiding this comment

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

I've checke a-e, all good, some very minor suggestions for improvements. I'll look at the rest later.

lib/clashom.gi Show resolved Hide resolved
lib/claspcgs.gi Outdated Show resolved Hide resolved
lib/claspcgs.gi Outdated Show resolved Hide resolved
lib/claspcgs.gi Outdated Show resolved Hide resolved
lib/ctbllatt.gi Outdated Show resolved Hide resolved
lib/cyclotom.gi Show resolved Hide resolved
Copy link
Member

@fingolfin fingolfin left a comment

Choose a reason for hiding this comment

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

Done a-f

lib/factgrp.gi Show resolved Hide resolved
lib/factgrp.gi Show resolved Hide resolved
lib/fastendo.gi Outdated Show resolved Hide resolved
lib/fastendo.gi Outdated Show resolved Hide resolved
lib/fpmon.gd Outdated Show resolved Hide resolved
lib/fpsemi.gi Outdated Show resolved Hide resolved
lib/fpsemi.gi Outdated Show resolved Hide resolved
@james-d-mitchell
Copy link
Contributor Author

Ugh, and I just accidentally force pushed and removed the changes that I merged on GitHub directly, I'll fix those again, sorry.

Also the latest commit in this PR removes some variables that are assigned but never used. I'm happy to put this in a separate PR if that's better, this change might be more problematic than the removal of unused local variables if the assignment of the variables has side effects. I've only removed those assigned but unused variables where I was fairly sure there'd be no side effects, in the other cases, I just remove the variable but left the right hand side of the assignment with a comment asking if the line is really required.

Copy link
Member

@fingolfin fingolfin left a comment

Choose a reason for hiding this comment

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

Done until and including grppccom.gi

A bunch of minor remarks; many are about formatting issues that were present before

lib/galois.gi Outdated Show resolved Hide resolved
lib/galois.gi Outdated Show resolved Hide resolved
lib/ghomfp.gi Outdated Show resolved Hide resolved
lib/gprdperm.gi Outdated Show resolved Hide resolved
lib/gprdperm.gi Outdated Show resolved Hide resolved
lib/grppc.gi Outdated Show resolved Hide resolved
lib/grppc.gi Outdated Show resolved Hide resolved
lib/grppc.gi Outdated Show resolved Hide resolved
lib/grppc.gi Outdated Show resolved Hide resolved
lib/grppcaut.gi Outdated Show resolved Hide resolved
Copy link
Member

@fingolfin fingolfin left a comment

Choose a reason for hiding this comment

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

Done a-l

lib/grppcfp.gi Show resolved Hide resolved
lib/grppcfp.gi Outdated Show resolved Hide resolved
lib/grppcfp.gi Outdated Show resolved Hide resolved
lib/grppcfp.gi Outdated Show resolved Hide resolved
lib/grppcnrm.gi Outdated Show resolved Hide resolved
lib/grppcnrm.gi Outdated Show resolved Hide resolved
Copy link
Member

@fingolfin fingolfin left a comment

Choose a reason for hiding this comment

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

Completed a-o

lib/mapprep.gi Outdated Show resolved Hide resolved
lib/mapprep.gi Outdated Show resolved Hide resolved
lib/meatauto.gi Outdated Show resolved Hide resolved
lib/mgmcong.gi Outdated Show resolved Hide resolved
lib/mgmcong.gi Outdated Show resolved Hide resolved
lib/mgmcong.gi Outdated Show resolved Hide resolved
lib/mgmhom.gi Outdated Show resolved Hide resolved
lib/mgmideal.gi Outdated Show resolved Hide resolved
lib/numtheor.gi Outdated Show resolved Hide resolved
lib/oprtpcgs.gi Outdated Show resolved Hide resolved
@ChrisJefferson
Copy link
Contributor

If this PR is squashed (not saying it has to be), could it be put into at least 3 commits?

  • Whitespace,
  • Remove variables which are never used,
  • Remove variables which were assigned, but then never used.

@james-d-mitchell
Copy link
Contributor Author

@ChrisJefferson yes, I'll do that once everything is ok

@james-d-mitchell
Copy link
Contributor Author

Thanks for the comments @fingolfin, I imagine it was as interesting to look at the changes in these files as it was to make them :) I think I've addressed all of your comments now, please let me know when you're done, so I can squash the commits according to what @ChrisJefferson suggested.

Copy link
Member

@fingolfin fingolfin left a comment

Choose a reason for hiding this comment

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

covered a-z now

lib/pcgsperm.gi Outdated Show resolved Hide resolved
lib/randiso.gi Outdated Show resolved Hide resolved
lib/relation.gi Outdated Show resolved Hide resolved
lib/relation.gi Outdated Show resolved Hide resolved
lib/relation.gi Outdated Show resolved Hide resolved
lib/stbcbckt.gi Outdated Show resolved Hide resolved
lib/stbcbckt.gi Outdated Show resolved Hide resolved
lib/streams.gi Outdated Show resolved Hide resolved
lib/tietze.gi Show resolved Hide resolved
lib/twocohom.gi Outdated Show resolved Hide resolved
@fingolfin
Copy link
Member

@james-d-mitchell how shall we proceed to get this merged? There are still comments by me (which I could apply, or not, or you; I am fine either way, just don't want to cause accidents).

Also, the linter CI actually fails?

@@ -1,5 +1,4 @@
disable:
- W000
Copy link
Member

Choose a reason for hiding this comment

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

I think these .gaplint.yml are not possible while there are still files in hpcgap/lib/ which are not de-tabbed

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@james-d-mitchell how shall we proceed to get this merged? There are still comments by me (which I could apply, or not, or you; I am fine either way, just don't want to cause accidents).

Also, the linter CI actually fails?

Thanks @fingolfin I'll finish this off at the start of next week when back at work, sorry for the seasonal delay :)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@fingolfin I think I've now finished this in the sense that I've remove all tabs, unused local variables, and assigned but not used local variables in the library, and in hpc gap. The latter required some changes to gaplint which I released in v1.1.4 a couple of moments ago, although I pushed to this branch after the release it looks like it might take a little longer to become available, and I'd expect the "lint" job pass when gaplint v1.1.4 is available.

Looks like one of the other tests has failed but I don't think that's related to this PR, although I might be wrong.

The final thing I'll do once this has the green light is to squash into the 3 commits that @ChrisJefferson suggested.

Copy link
Member

Choose a reason for hiding this comment

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

I've restarted the gaplint job. If it finishes, please squash as described.

The testexpect failure is indeed separate, see issue #5309

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Will squash now thanks!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Squashed, hopefully correctly.

@@ -656,7 +654,7 @@ InstallGlobalFunction( PresentationRegularPermutationGroupNC, function ( G )
if gen0[c] = 0 then
app[10] := g;
app[11] := c;
n := MakeConsequences( app );
MakeConsequences( app ); # TODO is this line required?
Copy link
Member

Choose a reason for hiding this comment

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

This line is definitely needed.

Suggested change
MakeConsequences( app ); # TODO is this line required?
MakeConsequences( app );

But fine by me to clean this up in a separate PR later (I can do it myself). Just wanted to mark it here so I don't forget.

(One CI test had a spurious failure due to a download timeout, I've just restarted it)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks @fingolfin !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release notes: not needed PRs introducing changes that are wholly irrelevant to the release notes topic: library
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants