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

Modernize code #3856

Merged
merged 8 commits into from
Aug 11, 2020
Merged

Modernize code #3856

merged 8 commits into from
Aug 11, 2020

Conversation

jngrad
Copy link
Member

@jngrad jngrad commented Aug 9, 2020

Fix multiple issues detected by lgtm tooling.

Description of changes:

  • python: catch specialized exceptions instead of BaseException (lgtm rule 6780080)
  • core: add include guards and modernize variable declarations (C++ Core Guidelines SF.8, ES.12, ES.22, ES.25, ES.49)

jngrad added 5 commits August 8, 2020 21:01
`BaseException` has three main subclasses: `KeyboardInterrupt`,
`SystemExit` and `Exception`. These three exceptions have to be
caught separately. In most cases, only `Exception` is relevant
(or one of its specialized subclasses).
Put local variable declarations in scopes, make them const
when applicable, don't mix signed types with unsigned types,
use static_cast instead of C-style casts, fix -Wshadow.
Global variables with external linkage cannot be initialized in the
global namespace, except when marked as const or constexpr.
@jngrad jngrad changed the title Modernize core Modernize code Aug 9, 2020
@jngrad jngrad force-pushed the variable-hotfixes branch from b3543aa to 19d66ef Compare August 9, 2020 16:37
@jngrad jngrad force-pushed the variable-hotfixes branch from 19d66ef to 8baa00a Compare August 9, 2020 17:05
samples/save_checkpoint.py Outdated Show resolved Hide resolved
src/core/electrostatics_magnetostatics/elc.cpp Outdated Show resolved Hide resolved
src/core/electrostatics_magnetostatics/fft.cpp Outdated Show resolved Hide resolved
src/core/electrostatics_magnetostatics/fft.cpp Outdated Show resolved Hide resolved
src/core/global.cpp Outdated Show resolved Hide resolved
src/core/global.cpp Outdated Show resolved Hide resolved
src/core/global.cpp Outdated Show resolved Hide resolved
src/core/global.cpp Outdated Show resolved Hide resolved
src/python/espressomd/reaction_ensemble.pyx Outdated Show resolved Hide resolved
@KaiSzuttor KaiSzuttor added the automerge Merge with kodiak label Aug 11, 2020
@kodiakhq kodiakhq bot merged commit 733756d into espressomd:python Aug 11, 2020
@jngrad jngrad added this to the Espresso 4.2 milestone Dec 15, 2020
@jngrad jngrad deleted the variable-hotfixes branch January 18, 2022 12:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants