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

Configuring git to handle eol #78

Merged
merged 8 commits into from
Jun 7, 2022
Merged

Configuring git to handle eol #78

merged 8 commits into from
Jun 7, 2022

Conversation

nariman87
Copy link
Contributor

@nariman87 nariman87 commented Jun 4, 2022

Context for changes

  • Improvements:
    • Added .gitattributes to the repository, so git automatically handles consistent eol's for all commits and contributors across different operating systems.

Example usage and tests

  • Not Applicable

Performance results justifying changes

  • Not Applicable

Workflow actions and tests

  • Not Applicable

Expected benefits and drawbacks

Expected benefits:

  • git will configure the end of files to be UNIX-style for all commits even for Windows users for consistency reasons and based on .gitattributes inputs. Now, it will be much more likely for GitHub to track file changes.

Possible drawbacks:

  • We may get unexpected and undesired changes to some files in the repo and need to restore them. For Reviewers: please create a main-old and a local backup from the current main before merging this PR. We may need to restore all files or let .gitattributes start from an empty repo. More details here.

Related Github issues

  • Not Applicable

Checklist and integration statements

  • My Python and C++ codes follow this project's coding and commenting styles as indicated by existing files. Precisely, the changes conform to given black, docformatter and pylint configurations.
  • I have performed a self-review of these changes, checked my code (including for codefactor compliance), and corrected misspellings to the best of my capacity. I have synced this branch with others as required.
  • I have added context for corresponding changes in documentation and README.md as needed.
  • I have added new workflow CI tests for corresponding changes, ensuring codecoverage is 95% or better, and these pass locally for me.
  • I have updated CHANGELOG.md following the template. I recognize that the developers may revisit CHANGELOG.md and the versioning, and create a Special Release including my changes.

@nariman87 nariman87 added chores Standard routines for open-source software projects programming conventions Provides better coding practices and align with standard formatting such as PEP labels Jun 4, 2022
@nariman87 nariman87 self-assigned this Jun 4, 2022
@codecov
Copy link

codecov bot commented Jun 4, 2022

Codecov Report

Merging #78 (8bdd624) into main (ccbdcd8) will not change coverage.
The diff coverage is 96.63%.

@@           Coverage Diff           @@
##             main      #78   +/-   ##
=======================================
  Coverage   96.28%   96.28%           
=======================================
  Files          36       36           
  Lines        2233     2233           
=======================================
  Hits         2150     2150           
  Misses         83       83           
Impacted Files Coverage Δ
flamingpy/cv/ops.py 91.57% <91.57%> (ø)
flamingpy/cv/macro_reduce.py 95.68% <95.68%> (ø)
flamingpy/simulations.py 96.80% <96.80%> (ø)
flamingpy/decoders/unionfind/uf_classes.py 99.08% <99.08%> (ø)
flamingpy/decoders/unionfind/algos.py 99.27% <99.27%> (ø)
flamingpy/__init__.py 100.00% <100.00%> (ø)
flamingpy/_version.py 100.00% <100.00%> (ø)
flamingpy/decoders/mwpm/algos.py 100.00% <100.00%> (ø)
flamingpy/examples/decoding.py 100.00% <100.00%> (ø)
flamingpy/examples/surface_code.py 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ccbdcd8...8bdd624. Read the comment docs.

Copy link
Contributor

@sduquemesa sduquemesa left a comment

Choose a reason for hiding this comment

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

Thanks @nariman87, this is great and can save devs some headaches in the long run! Let's hope it won't be to intrusive for the current devs.

@@ -20,7 +21,7 @@

This release contains contributions from (in alphabetical order):

[Joost Bus](https://github.com/soosub), [Sebastián Duque Mesa](https://github.com/sduquemesa), [Luis Mantilla](https://github.com/BestQuark)
[Joost Bus](https://github.com/soosub), [Sebastián Duque Mesa](https://github.com/sduquemesa), [Luis Mantilla](https://github.com/BestQuark), Nariman Saadatmand
Copy link
Contributor

Choose a reason for hiding this comment

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

Don't forget to add your github handle 📲

Suggested change
[Joost Bus](https://github.com/soosub), [Sebastián Duque Mesa](https://github.com/sduquemesa), [Luis Mantilla](https://github.com/BestQuark), Nariman Saadatmand
[Joost Bus](https://github.com/soosub), [Sebastián Duque Mesa](https://github.com/sduquemesa), [Luis Mantilla](https://github.com/BestQuark), [Nariman Saadatmand](https://github.com/nariman87)

Copy link
Contributor Author

@nariman87 nariman87 Jun 6, 2022

Choose a reason for hiding this comment

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

Let's avoid doing that for now, thanks.

Copy link
Collaborator

@ilan-tz ilan-tz left a comment

Choose a reason for hiding this comment

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

Thank for this @nariman87 ! The PR is meant to address some annoying "false positive" differences in files GitHub keeps finding. It has happened in a few PRs, but maybe #55 could be a good test case for the fix

Do you think these changes correct the behaviour we observe in examples/surface_code.py?

Also, after merging this PR, would we have to follow the instructions here (the section Refreshing a repository after changing line endings)?

@nariman87
Copy link
Contributor Author

nariman87 commented Jun 6, 2022

Thank for this @nariman87 ! The PR is meant to address some annoying "false positive" differences in files GitHub keeps finding. It has happened in a few PRs, but maybe #55 could be a good test case for the fix

Do you think these changes correct the behaviour we observe in examples/surface_code.py?

Also, after merging this PR, would we have to follow the instructions here (the section Refreshing a repository after changing line endings)?

Not essentially, full refreshing may or may not be required, we need to see and must backup to main-old.

A better solution could be to make a super minor change to or delete problematic files and then commit them, so git automatically fix them. I may do some follow-up PRs.

I would say it quite possibly resolves the issue with that PR, but cannot be certain until we merge this and then make more changes as needed.

@nariman87 nariman87 merged commit 489d50b into main Jun 7, 2022
@nariman87 nariman87 deleted the auto-eol branch June 7, 2022 01:20
soosub pushed a commit that referenced this pull request Jul 29, 2022
* Update _version.py

* Update setup.py

* Update README.md

* Update dev_requirements.txt

* Update DOCS.rst

* Update test_graphstates.py

* Update _version.py

* Update __init__.py

* Update gkp.py

* Update matching.py

* Update shortest_path.py

* Update simulations.py

* Update requirements.txt

* Update dev_requirements.txt

* Rename requirements.txt to dev_requirements.txt

* Update Makefile

* Update dev_requirements.txt

* Update dev_requirements.txt

* Update index.rst

* Update index.rst

* Update conf.py

* Update index.rst

* Update and rename index.rst to intro_page.rst

* Added usage/ tree for docs ...

* Rename getting_started to getting_started.rst

* Update getting_started.rst

* Create tutorials.rst

* Create package_installation.rst

* Update package_installation.rst

* Update intro_page.rst

* Update and rename development_guide.rst to guide_for_devs.rst

* Delete doc/introduction directory

* Update README.md

* Update intro_page.rst

* Added help/ tree for docs ...

* Update and rename intro_page.rst to index.rst

* Update index.rst

* Rename package_installation.rst to easy_installation.rst

* Update easy_installation.rst

* Update guide_for_devs.rst

* Update index.rst

* Update index.rst

* Update easy_installation.rst

* Update guide_for_devs.rst

* Update guide_for_devs.rst

* Update guide_for_devs.rst

* Update and rename install.html to installation_at_a_glance.html

* Update installation_at_a_glance.html

* Rename installation_at_a_glance.html to install.html

* Create contribution.rst

* Update index.rst

* Update build_tests.yaml

* Update format.yaml

* Update linting.yaml

* Update upload_linux_x64.yaml

* Update upload_macos_x64.yaml

* Update upload_win_x64.yaml

* Update pull_request_template.md

* Update README.md

* Update macro_reduce.py

* Update setup.py

* Update build_tests.yaml

* Update upload_linux_x64.yaml

* Update upload_macos_x64.yaml

* Update upload_win_x64.yaml

* Running black ...

* Update setup.py

* Update setup.py

* Update setup.py

* Update setup.py

* Update setup.py

* Update dev_requirements.txt

* Update dev_requirements.txt

* Update dev_requirements.txt

* Update setup.py

* Update dev_requirements.txt

* Update dev_requirements.txt

* Update format.yaml

* Update dev_requirements.txt

* docformatting macro_reduce.py ...

* Update upload_linux_x64.yaml

* Update setup.py

* Update setup.py

* Update setup.py

* Delete MANIFEST.in

* Update setup.py

* Update setup.py

* Update setup.py

* Update setup.py

* Update setup.py

* Update setup.py

* Update setup.py

* Update setup.py

* Update setup.py

* Update setup.py

* Update setup.py

* Create MANIFEST.in

* Update MANIFEST.in

* Update MANIFEST.in

* Update setup.py

* Update MANIFEST.in

* Update lemonpy.cpp

* Update _version.py

* Update CODEOWNERS

* Update upload_win_x64.yaml

* Update _version.py

* Update upload_win_x64.yaml

* Update _version.py

* Update Makefile

* Update Makefile

* Update Makefile

* Update DOCS.rst

* Update index.rst

* Rename DOCS.rst to documentation.rst

* Update Makefile

* Moving and renaming DOCS.rst ...

* Update and rename documentation.rst to build_docs.rst

* Update index.rst

* Update README.md

Co-authored-by: ilan-tz <57886357+ilan-tz@users.noreply.github.com>

* Update contribution.rst

* Update README.md

* Update doc/development/guide_for_devs.rst

Co-authored-by: ilan-tz <57886357+ilan-tz@users.noreply.github.com>

* Update doc/development/guide_for_devs.rst

Co-authored-by: ilan-tz <57886357+ilan-tz@users.noreply.github.com>

* Update upload_win_x64.yaml

* Update _version.py

* Update setup.py

* Update upload_win_x64.yaml

* Update setup.py

* Update _version.py

* Update setup.py

* Update setup.py

* Ugly workaround to make MANIFEST.in working with Windows

* Update upload_linux_x64.yaml

* Update upload_macos_x64.yaml

* Update upload_win_x64.yaml

* Update _version.py

* Update upload_linux_x64.yaml

* Update upload_macos_x64.yaml

* Update upload_win_x64.yaml

* Update doc/development/contribution.rst

Co-authored-by: ilan-tz <57886357+ilan-tz@users.noreply.github.com>

* Update README.md

Co-authored-by: ilan-tz <57886357+ilan-tz@users.noreply.github.com>

Co-authored-by: ilan-tz <57886357+ilan-tz@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
chores Standard routines for open-source software projects programming conventions Provides better coding practices and align with standard formatting such as PEP
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants