mirror of https://github.com/nicolargo/glances.git
Remove duplicate line at the end of files
This commit is contained in:
parent
c970932e96
commit
0bf79775b6
3
Makefile
3
Makefile
|
|
@ -138,6 +138,9 @@ test-export: test-export-csv test-export-json test-export-influxdb-v1 test-expor
|
|||
# Linters, profilers and cyber security
|
||||
# ===================================================================
|
||||
|
||||
find-duplicate-lines:
|
||||
sh ./tests-data/tools/find-duplicate-lines.sh
|
||||
|
||||
format: ## Format the code
|
||||
$(venv_full)/python -m ruff format .
|
||||
|
||||
|
|
|
|||
|
|
@ -188,4 +188,3 @@ def main():
|
|||
|
||||
# Glances can be ran in standalone, client or server mode
|
||||
start(config=core.get_config(), args=core.get_args())
|
||||
start(config=core.get_config(), args=core.get_args())
|
||||
|
|
|
|||
|
|
@ -365,4 +365,3 @@ class Config:
|
|||
return self.parser.getboolean(section, option)
|
||||
except (NoOptionError, NoSectionError):
|
||||
return bool(default)
|
||||
return bool(default)
|
||||
|
|
|
|||
|
|
@ -320,4 +320,3 @@ class QuicklookPlugin(GlancesPluginModel):
|
|||
def _mhz_to_hz(self, hz):
|
||||
"""Convert Mhz to Hz."""
|
||||
return hz * 1000000.0
|
||||
return hz * 1000000.0
|
||||
|
|
|
|||
|
|
@ -419,4 +419,3 @@ please rename it to "{plugin_path.capitalize()}Plugin"'
|
|||
# Close plugins
|
||||
for p in self._plugins:
|
||||
self._plugins[p].exit()
|
||||
self._plugins[p].exit()
|
||||
|
|
|
|||
|
|
@ -0,0 +1,9 @@
|
|||
find ./glances/ -type f -name "*.py" -exec sh -c '
|
||||
for file; do
|
||||
last_line=$(tail -n 1 "$file")
|
||||
second_last_line=$(tail -n 2 "$file" | head -n 1)
|
||||
if [ -n "$last_line" ] && [ -n "$second_last_line" ] && [ "$last_line" = "$second_last_line" ]; then
|
||||
echo "Duplicate last line in: $file"
|
||||
fi
|
||||
done
|
||||
' sh {} +
|
||||
Loading…
Reference in New Issue